diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.csproj b/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.csproj index 7e99a627fb3b..30021efc9299 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.csproj +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.csproj @@ -2,9 +2,9 @@ ConnectedMachine ConnectedMachine + ConnectedMachine.Autorest - diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.format.ps1xml b/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.format.ps1xml index ef9abaa79643..1f6ff5536104 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.format.ps1xml +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.format.ps1xml @@ -237,82 +237,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Location - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - ResourceGroupName - - - MachineName - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AccessRule @@ -455,62 +379,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersion - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersion#Multiple - - - - - - - - - - - - - - - - - - AgentVersion1 - - - DownloadLink - - - OSType - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersionsList - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersionsList#Multiple - - - - - - - - - - - - NextLink - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AvailablePatchCountByClassification @@ -632,24 +500,12 @@ - - - - - - - - - - - - @@ -665,15 +521,9 @@ - - - - - - @@ -689,18 +539,9 @@ - - - - - - - - - @@ -711,24 +552,12 @@ - - BaseProvider - - - BaseResourceName - - - BaseResourceType - ExtensionName ExtensionType - - GatewayName - GroupName @@ -744,15 +573,9 @@ MachineName - - MetadataName - Name - - OSType - PerimeterName @@ -768,18 +591,9 @@ ResourceGroupName - - ResourceUri - - - RunCommandName - ScopeName - - SettingsResourceName - SubscriptionId @@ -887,40 +701,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGenerated - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGenerated#Multiple - - - - - - - - - - - - - - - - - - Code - - - Message - - - Target - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.EsuKey @@ -1137,138 +917,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Location - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - ResourceGroupName - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayProperties - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayProperties#Multiple - - - - - - - - - - - - - - - - - - - - - GatewayEndpoint - - - GatewayId - - - GatewayType - - - ProvisioningState - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewaysListResult - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewaysListResult#Multiple - - - - - - - - - - - - NextLink - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope @@ -1299,136 +947,16 @@ ResourceGroupName - Name - - - Location - - - PublicNetworkAccess - - - ProvisioningState - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult#Multiple - - - - - - - - - - - - NextLink - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeProperties - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeProperties#Multiple - - - - - - - - - - - - - - - - - - PrivateLinkScopeId - - - ProvisioningState - - - PublicNetworkAccess - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadata - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadata#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt + Name - SystemDataLastModifiedBy + Location - SystemDataLastModifiedByType + PublicNetworkAccess - ResourceGroupName + ProvisioningState @@ -1436,9 +964,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataList + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataList#Multiple + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult#Multiple @@ -1458,27 +986,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataProperties + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeProperties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataProperties#Multiple + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeProperties#Multiple - + - + + + + - PublicKey + PrivateLinkScopeId - VMId + ProvisioningState + + + PublicNetworkAccess @@ -2767,286 +2301,22 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceView - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceView#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EndTime - - - Error - - - ExecutionMessage - - - ExecutionState - - - ExitCode - - - Output - - - StartTime - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandProperties - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandProperties#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AsyncExecution - - - ErrorBlobUri - - - OutputBlobUri - - - ProvisioningState - - - RunAsPassword - - - RunAsUser - - - TimeoutInSecond - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSource - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSource#Multiple - - - - - - - - - - - - - - - - - - CommandId - - - Script - - - ScriptUri - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandsListResult - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandsListResult#Multiple - - - - - - - - - - - - NextLink - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineUpdate Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineUpdate#Multiple - - - - - - - - - - Kind - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineUpdateProperties - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineUpdateProperties#Multiple - - - - - - - - - - - - - - - ParentClusterResourceId - - - PrivateLinkScopeResourceId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - + + + + + + + + - ResourceGroupName + Kind @@ -3054,39 +2324,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfigurationProperties + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineUpdateProperties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfigurationProperties#Multiple + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineUpdateProperties#Multiple - - - - - - - + - + - Location - - - NetworkConfigurationScopeId - - - NetworkConfigurationScopeResourceId + ParentClusterResourceId - TenantId + PrivateLinkScopeResourceId @@ -3193,6 +2451,28 @@ + + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationReconcileResult + + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationReconcileResult#Multiple + + + + + + + + + + + + Location + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterProfile @@ -4103,62 +3383,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameter - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameter#Multiple - - - - - - - - - - - - - - - Name - - - Value - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity#Multiple - - - - - - - - - - - - - - - ClientId - - - ObjectId - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ServiceStatus @@ -4187,114 +3411,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - ResourceGroupName - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayProperties - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayProperties#Multiple - - - - - - - - - - - - GatewayResourceId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsProperties - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsProperties#Multiple - - - - - - - - - - - - TenantId - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Subnet @@ -4455,70 +3571,6 @@ - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceAutoGenerated - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceAutoGenerated#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - Location - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTags diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psd1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psd1 index be971ab2197f..4220191f841f 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psd1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psd1 @@ -1,5 +1,5 @@ @{ - GUID = '259a0542-8329-4b9e-8f72-dab0efc583e9' + GUID = '368c49bb-8fdf-4c4d-96bd-47d9f9cd5734' RootModule = './Az.ConnectedMachine.psm1' ModuleVersion = '0.1.0' CompatiblePSEditions = 'Core', 'Desktop' diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/Properties/AssemblyInfo.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/Properties/AssemblyInfo.cs index e4ca7a6ee8ea..2a8fc1b56aef 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/Properties/AssemblyInfo.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - ConnectedMachine")] -[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("1c3a6300-5308-40da-983c-64817bcf0468")] -[assembly: AssemblyVersion("0.9.0")] -[assembly: AssemblyFileVersion("0.9.0")] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ConnectedMachine")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.9.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.9.0")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineRunCommand.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineRunCommand.ps1 deleted file mode 100644 index b539431f8f8f..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Get-AzConnectedMachineRunCommand.ps1 +++ /dev/null @@ -1,204 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -The operation to get a run command. -.Description -The operation to get a run command. -.Example -Get-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -MachineName "testmachine" -.Example -Get-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand2" -MachineName "testmachine" - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand -.Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/get-azconnectedmachineruncommand -#> -function Get-AzConnectedMachineRunCommand { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${MachineName}, - - [Parameter(Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the run command. - ${RunCommandName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Query')] - [System.String] - # The expand expression to apply on the operation. - ${Expand}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Get = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_Get'; - List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 index 399b49efe7c9..bcdd1f717891 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Install-AzConnectedMachinePatch.ps1 @@ -34,30 +34,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 index 8eb12c408eb1..52a8ce6f723c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedAssessMachinePatch.ps1 @@ -32,30 +32,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineRunCommand.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration.ps1 similarity index 80% rename from generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineRunCommand.ps1 rename to generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration.ps1 index 45996e74784f..11ae73048345 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineRunCommand.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration.ps1 @@ -16,90 +16,73 @@ <# .Synopsis -The operation to delete a run command. +Forces the network security perimeter configuration to refresh for a private link scope. .Description -The operation to delete a run command. +Forces the network security perimeter configuration to refresh for a private link scope. .Example -Remove-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand3" -MachineName "testmachine" +Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration -PerimeterName $env.PerimeterName -ResourceGroupName $env.ResourceGroupNameNSP -ScopeName $env.PrivateLinkScopeNameNSP .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult .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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. -MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. +PRIVATELINKSCOPEINPUTOBJECT : Identity Parameter [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachineruncommand +https://learn.microsoft.com/powershell/module/az.connectedmachine/invoke-azconnectedreconcilenetworksecurityperimeterconfiguration #> -function Remove-AzConnectedMachineRunCommand { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult])] +[CmdletBinding(DefaultParameterSetName='Reconcile', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='Reconcile', Mandatory)] + [Parameter(ParameterSetName='ReconcileViaIdentityPrivateLinkScope', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the hybrid machine. - ${MachineName}, + # The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + ${PerimeterName}, - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='Reconcile', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] @@ -107,31 +90,30 @@ param( # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory)] + [Parameter(ParameterSetName='Reconcile', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the run command. - ${RunCommandName}, + # The name of the Azure Arc PrivateLinkScope resource. + ${ScopeName}, - [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='Reconcile')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ReconcileViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ReconcileViaIdentityPrivateLinkScope', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter - ${MachineInputObject}, + ${PrivateLinkScopeInputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -174,12 +156,6 @@ param( # Run the command asynchronously ${NoWait}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] @@ -226,11 +202,11 @@ begin { } $mapping = @{ - Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_Delete'; - DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentity'; - DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentityMachine'; + Reconcile = 'Az.ConnectedMachine.private\Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile'; + ReconcileViaIdentity = 'Az.ConnectedMachine.private\Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity'; + ReconcileViaIdentityPrivateLinkScope = 'Az.ConnectedMachine.private\Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('Reconcile') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedLicense.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedLicense.ps1 index fb3fd8c7a153..32391614093e 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedLicense.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedLicense.ps1 @@ -34,30 +34,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 index c0f6c43a0695..35a384b56de3 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineExtension.ps1 @@ -70,58 +70,40 @@ EXTENSIONPARAMETER : Describes a Machine Extension. [TypeHandlerVersion ]: Specifies the version of the script handler. INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineRunCommand.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineRunCommand.ps1 deleted file mode 100644 index 97031c154684..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedMachineRunCommand.ps1 +++ /dev/null @@ -1,555 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -The operation to create a run command. -.Description -The operation to create a run command. -.Example -New-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -Location "eastus2euap" -SourceScript "Write-Host Hello World!" -RunCommandName "myRunCommand3" -MachineName "testmachine" -SubscriptionId ********-****-****-****-********** - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand -.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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -PARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -PROTECTEDPARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -RUNCOMMANDPROPERTY : Describes a Run Command - Location : The geo-location where the resource lives - [Tags ]: Resource tags. - [(Any) ]: This indicates any property can be added to this object. - [AsyncExecution ]: Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - [ErrorBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ErrorBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [ErrorBlobUri ]: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - [OutputBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [OutputBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [OutputBlobUri ]: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - [Parameter >]: The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - [ProtectedParameter >]: The parameters used by the script. - [RunAsPassword ]: Specifies the user account password on the machine when executing the run command. - [RunAsUser ]: Specifies the user account on the machine when executing the run command. - [ScriptUriManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ScriptUriManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [SourceCommandId ]: Specifies the commandId of predefined built-in script. - [SourceScript ]: Specifies the script content to be executed on the machine. - [SourceScriptUri ]: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - [TimeoutInSecond ]: The timeout in seconds to execute the run command. -.Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedmachineruncommand -#> -function New-AzConnectedMachineRunCommand { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${MachineName}, - - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the run command. - ${RunCommandName}, - - [Parameter(ParameterSetName='Create')] - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaJsonFilePath')] - [Parameter(ParameterSetName='CreateViaJsonString')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${MachineInputObject}, - - [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand] - # Describes a Run Command - ${RunCommandProperty}, - - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] - [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # The geo-location where the resource lives - ${Location}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Optional. - # If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - ${AsyncExecution}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ErrorBlobManagedIdentityClientId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ErrorBlobManagedIdentityObjectId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the Azure storage blob where script error stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer errorBlobManagedIdentity parameter. - ${ErrorBlobUri}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${OutputBlobManagedIdentityClientId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${OutputBlobManagedIdentityObjectId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the Azure storage blob where script output stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer outputBlobManagedIdentity parameter. - ${OutputBlobUri}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${Parameter}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${ProtectedParameter}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the user account password on the machine when executing the run command. - ${RunAsPassword}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the user account on the machine when executing the run command. - ${RunAsUser}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ScriptUriManagedIdentityClientId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ScriptUriManagedIdentityObjectId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the commandId of predefined built-in script. - ${SourceCommandId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the script content to be executed on the machine. - ${SourceScript}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the script download location. - # It can be either SAS URI of an Azure storage blob with read access or public URI. - ${SourceScriptUri}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Int32] - # The timeout in seconds to execute the run command. - ${TimeoutInSecond}, - - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Path of Json file supplied to the Create operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Json string supplied to the Create operation - ${JsonString}, - - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - ${ScriptLocalPath}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Create = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_Create'; - CreateExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateExpanded'; - CreateViaIdentity = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentity'; - CreateViaIdentityExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityExpanded'; - CreateViaIdentityMachine = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityMachine'; - CreateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded'; - CreateViaJsonFilePath = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaJsonString'; - ScriptLocalPath = 'Az.ConnectedMachine.custom\New-AzConnectedMachineRunCommand_ScriptLocalPath'; - } - if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString', 'ScriptLocalPath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 index 0c0ab7c1a61d..f79cb8dd1c89 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/New-AzConnectedPrivateLinkScope.ps1 @@ -36,30 +36,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 index 8ac9dcb1f852..b39539a5e0c0 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -571,195 +571,6 @@ end { } } -<# -.Synopsis -The operation to get a run command. -.Description -The operation to get a run command. -.Example -Get-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -MachineName "testmachine" -.Example -Get-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand2" -MachineName "testmachine" - -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand -.Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/get-azconnectedmachineruncommand -#> -function Get-AzConnectedMachineRunCommand { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${MachineName}, - - [Parameter(Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the run command. - ${RunCommandName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String[]] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='List')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Query')] - [System.String] - # The expand expression to apply on the operation. - ${Expand}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Get = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_Get'; - List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_List'; - } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} - <# .Synopsis Retrieves information about the model view or the instance view of a hybrid machine. @@ -1329,30 +1140,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. @@ -1682,30 +1484,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link @@ -1892,90 +1685,73 @@ end { <# .Synopsis -The operation to create a license. +Forces the network security perimeter configuration to refresh for a private link scope. .Description -The operation to create a license. +Forces the network security perimeter configuration to refresh for a private link scope. .Example -New-AzConnectedLicense -Name 'myESULicense' -ResourceGroupName 'ytongtest' -Location 'eastus2euap' -LicenseType 'ESU' -LicenseDetailState 'Activated' -LicenseDetailTarget 'Windows Server 2012' -LicenseDetailEdition 'Datacenter' -LicenseDetailType 'pCore' -LicenseDetailProcessor 16 -SubscriptionId ********-****-****-****-********** +Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration -PerimeterName $env.PerimeterName -ResourceGroupName $env.ResourceGroupNameNSP -ScopeName $env.PrivateLinkScopeNameNSP .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult .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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. -LICENSEDETAILVOLUMELICENSEDETAIL : A list of volume license details. - [InvoiceId ]: The invoice id for the volume license. - [ProgramYear ]: Describes the program year the volume license is for. - -PARAMETER : Describes a license in a hybrid machine. - Location : The geo-location where the resource lives - [Tags ]: Resource tags. - [(Any) ]: This indicates any property can be added to this object. - [DetailEdition ]: Describes the edition of the license. The values are either Standard or Datacenter. - [DetailProcessor ]: Describes the number of processors. - [DetailState ]: Describes the state of the license. - [DetailTarget ]: Describes the license target server. - [DetailType ]: Describes the license core type (pCore or vCore). - [DetailVolumeLicenseDetail >]: A list of volume license details. - [InvoiceId ]: The invoice id for the volume license. - [ProgramYear ]: Describes the program year the volume license is for. - [LicenseType ]: The type of the license resource. - [TenantId ]: Describes the tenant id. +PRIVATELINKSCOPEINPUTOBJECT : Identity Parameter + [ExtensionName ]: The name of the machine extension. + [ExtensionType ]: The extensionType of the Extension being received. + [GroupName ]: The name of the private link resource. + [Id ]: Resource identity path + [LicenseName ]: The name of the license. + [LicenseProfileName ]: The name of the license profile. + [Location ]: The location of the Extension being received. + [MachineName ]: The name of the hybrid machine. + [Name ]: The name of the hybrid machine. + [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. + [Publisher ]: The publisher of the Extension being received. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. + [SubscriptionId ]: The ID of the target subscription. + [Version ]: The version of the Extension being received. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedlicense +https://learn.microsoft.com/powershell/module/az.connectedmachine/invoke-azconnectedreconcilenetworksecurityperimeterconfiguration #> -function New-AzConnectedLicense { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult])] +[CmdletBinding(DefaultParameterSetName='Reconcile', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Alias('LicenseName')] + [Parameter(ParameterSetName='Reconcile', Mandatory)] + [Parameter(ParameterSetName='ReconcileViaIdentityPrivateLinkScope', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the license. - ${Name}, + # The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + ${PerimeterName}, - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='Reconcile', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] @@ -1983,31 +1759,290 @@ param( # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Create')] - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaJsonFilePath')] - [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='Reconcile', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [System.String] + # The name of the Azure Arc PrivateLinkScope resource. + ${ScopeName}, + + [Parameter(ParameterSetName='Reconcile')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ReconcileViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense] - # Describes a license in a hybrid machine. - ${Parameter}, + [Parameter(ParameterSetName='ReconcileViaIdentityPrivateLinkScope', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] + # Identity Parameter + ${PrivateLinkScopeInputObject}, - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Reconcile = 'Az.ConnectedMachine.private\Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile'; + ReconcileViaIdentity = 'Az.ConnectedMachine.private\Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity'; + ReconcileViaIdentityPrivateLinkScope = 'Az.ConnectedMachine.private\Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope'; + } + if (('Reconcile') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The operation to create a license. +.Description +The operation to create a license. +.Example +New-AzConnectedLicense -Name 'myESULicense' -ResourceGroupName 'ytongtest' -Location 'eastus2euap' -LicenseType 'ESU' -LicenseDetailState 'Activated' -LicenseDetailTarget 'Windows Server 2012' -LicenseDetailEdition 'Datacenter' -LicenseDetailType 'pCore' -LicenseDetailProcessor 16 -SubscriptionId ********-****-****-****-********** + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense +.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 + [ExtensionName ]: The name of the machine extension. + [ExtensionType ]: The extensionType of the Extension being received. + [GroupName ]: The name of the private link resource. + [Id ]: Resource identity path + [LicenseName ]: The name of the license. + [LicenseProfileName ]: The name of the license profile. + [Location ]: The location of the Extension being received. + [MachineName ]: The name of the hybrid machine. + [Name ]: The name of the hybrid machine. + [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. + [Publisher ]: The publisher of the Extension being received. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. + [SubscriptionId ]: The ID of the target subscription. + [Version ]: The version of the Extension being received. + +LICENSEDETAILVOLUMELICENSEDETAIL : A list of volume license details. + [InvoiceId ]: The invoice id for the volume license. + [ProgramYear ]: Describes the program year the volume license is for. + +PARAMETER : Describes a license in a hybrid machine. + Location : The geo-location where the resource lives + [Tags ]: Resource tags. + [(Any) ]: This indicates any property can be added to this object. + [DetailEdition ]: Describes the edition of the license. The values are either Standard or Datacenter. + [DetailProcessor ]: Describes the number of processors. + [DetailState ]: Describes the state of the license. + [DetailTarget ]: Describes the license target server. + [DetailType ]: Describes the license core type (pCore or vCore). + [DetailVolumeLicenseDetail >]: A list of volume license details. + [InvoiceId ]: The invoice id for the volume license. + [ProgramYear ]: Describes the program year the volume license is for. + [LicenseType ]: The type of the license resource. + [TenantId ]: Describes the tenant id. +.Link +https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedlicense +#> +function New-AzConnectedLicense { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Alias('LicenseName')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [System.String] + # The name of the license. + ${Name}, + + [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Create')] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] + # Identity Parameter + ${InputObject}, + + [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense] + # Describes a license in a hybrid machine. + ${Parameter}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] @@ -2307,58 +2342,40 @@ EXTENSIONPARAMETER : Describes a Machine Extension. [TypeHandlerVersion ]: Specifies the version of the script handler. INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link @@ -2752,132 +2769,60 @@ end { <# .Synopsis -The operation to create a run command. -.Description -The operation to create a run command. +create (or create a Azure Arc PrivateLinkScope. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +.Description +create (or create a Azure Arc PrivateLinkScope. +Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example -New-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -Location "eastus2euap" -SourceScript "Write-Host Hello World!" -RunCommandName "myRunCommand3" -MachineName "testmachine" -SubscriptionId ********-****-****-****-********** +New-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName -PublicNetworkAccess "Enabled" -Location $location .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. -PARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -PROTECTEDPARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -RUNCOMMANDPROPERTY : Describes a Run Command - Location : The geo-location where the resource lives - [Tags ]: Resource tags. +PARAMETER : An Azure Arc PrivateLinkScope definition. + Location : Resource location + [Tags ]: Resource tags [(Any) ]: This indicates any property can be added to this object. - [AsyncExecution ]: Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - [ErrorBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ErrorBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [ErrorBlobUri ]: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - [OutputBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [OutputBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [OutputBlobUri ]: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - [Parameter >]: The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - [ProtectedParameter >]: The parameters used by the script. - [RunAsPassword ]: Specifies the user account password on the machine when executing the run command. - [RunAsUser ]: Specifies the user account on the machine when executing the run command. - [ScriptUriManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ScriptUriManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [SourceCommandId ]: Specifies the commandId of predefined built-in script. - [SourceScript ]: Specifies the script content to be executed on the machine. - [SourceScriptUri ]: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - [TimeoutInSecond ]: The timeout in seconds to execute the run command. + [PublicNetworkAccess ]: Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedmachineruncommand +https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedprivatelinkscope #> -function New-AzConnectedMachineRunCommand { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] +function New-AzConnectedPrivateLinkScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${MachineName}, - - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] @@ -2887,21 +2832,17 @@ param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the run command. - ${RunCommandName}, + # The name of the Azure Arc PrivateLinkScope resource. + ${ScopeName}, [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Parameter(ParameterSetName='CreateViaJsonString')] - [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -2915,208 +2856,37 @@ param( # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${MachineInputObject}, - [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand] - # Describes a Run Command - ${RunCommandProperty}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope] + # An Azure Arc PrivateLinkScope definition. + ${Parameter}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] - [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # The geo-location where the resource lives + # Resource location ${Location}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Optional. - # If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - ${AsyncExecution}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ErrorBlobManagedIdentityClientId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ErrorBlobManagedIdentityObjectId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the Azure storage blob where script error stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer errorBlobManagedIdentity parameter. - ${ErrorBlobUri}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${OutputBlobManagedIdentityClientId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${OutputBlobManagedIdentityObjectId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the Azure storage blob where script output stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer outputBlobManagedIdentity parameter. - ${OutputBlobUri}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${Parameter}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${ProtectedParameter}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the user account password on the machine when executing the run command. - ${RunAsPassword}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the user account on the machine when executing the run command. - ${RunAsUser}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ScriptUriManagedIdentityClientId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ScriptUriManagedIdentityObjectId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the commandId of predefined built-in script. - ${SourceCommandId}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the script content to be executed on the machine. - ${SourceScript}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Enabled", "Disabled", "SecuredByPerimeter")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Specifies the script download location. - # It can be either SAS URI of an Azure storage blob with read access or public URI. - ${SourceScriptUri}, + # Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. + ${PublicNetworkAccess}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateLinkScopesResourceTags]))] [System.Collections.Hashtable] - # Resource tags. + # Resource tags ${Tag}, - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Int32] - # The timeout in seconds to execute the run command. - ${TimeoutInSecond}, - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] @@ -3129,11 +2899,6 @@ param( # Json string supplied to the Create operation ${JsonString}, - [Parameter(ParameterSetName='ScriptLocalPath')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - ${ScriptLocalPath}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3143,12 +2908,6 @@ param( # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -3169,12 +2928,6 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] @@ -3221,17 +2974,14 @@ begin { } $mapping = @{ - Create = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_Create'; - CreateExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateExpanded'; - CreateViaIdentity = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentity'; - CreateViaIdentityExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityExpanded'; - CreateViaIdentityMachine = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityMachine'; - CreateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded'; - CreateViaJsonFilePath = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaJsonString'; - ScriptLocalPath = 'Az.ConnectedMachine.custom\New-AzConnectedMachineRunCommand_ScriptLocalPath'; - } - if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString', 'ScriptLocalPath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + Create = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_Create'; + CreateExpanded = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateExpanded'; + CreateViaIdentity = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaIdentity'; + CreateViaIdentityExpanded = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonString'; + } + if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { @@ -3292,69 +3042,54 @@ end { <# .Synopsis -create (or create a Azure Arc PrivateLinkScope. -Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +The operation to delete a license. .Description -create (or create a Azure Arc PrivateLinkScope. -Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. +The operation to delete a license. .Example -New-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName -PublicNetworkAccess "Enabled" -Location $location +Remove-AzConnectedLicense -Name 'myESULicense' -ResourceGroupName 'ytongtest' -SubscriptionId ********-****-****-****-********** .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope +System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. - -PARAMETER : An Azure Arc PrivateLinkScope definition. - Location : Resource location - [Tags ]: Resource tags - [(Any) ]: This indicates any property can be added to this object. - [PublicNetworkAccess ]: Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedprivatelinkscope +https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedlicense #> -function New-AzConnectedPrivateLinkScope { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Remove-AzConnectedLicense { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('LicenseName')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [System.String] + # The name of the license. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] @@ -3362,75 +3097,19 @@ param( # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Create', Mandatory)] - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the Azure Arc PrivateLinkScope resource. - ${ScopeName}, - - [Parameter(ParameterSetName='Create')] - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaJsonFilePath')] - [Parameter(ParameterSetName='CreateViaJsonString')] + [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope] - # An Azure Arc PrivateLinkScope definition. - ${Parameter}, - - [Parameter(ParameterSetName='CreateExpanded', Mandatory)] - [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] - [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Resource location - ${Location}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Enabled", "Disabled", "SecuredByPerimeter")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. - ${PublicNetworkAccess}, - - [Parameter(ParameterSetName='CreateExpanded')] - [Parameter(ParameterSetName='CreateViaIdentityExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateLinkScopesResourceTags]))] - [System.Collections.Hashtable] - # Resource tags - ${Tag}, - - [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Path of Json file supplied to the Create operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Json string supplied to the Create operation - ${JsonString}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3440,6 +3119,12 @@ param( # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -3460,6 +3145,18 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] @@ -3506,14 +3203,10 @@ begin { } $mapping = @{ - Create = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_Create'; - CreateExpanded = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateExpanded'; - CreateViaIdentity = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaIdentity'; - CreateViaIdentityExpanded = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaIdentityExpanded'; - CreateViaJsonFilePath = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonFilePath'; - CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonString'; + Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedLicense_Delete'; + DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedLicense_DeleteViaIdentity'; } - if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { @@ -3574,11 +3267,13 @@ end { <# .Synopsis -The operation to delete a license. +The operation to delete the extension. .Description -The operation to delete a license. +The operation to delete the extension. .Example -Remove-AzConnectedLicense -Name 'myESULicense' -ResourceGroupName 'ytongtest' -SubscriptionId ********-****-****-****-********** +Remove-AzConnectedMachineExtension -MachineName myMachine -ResourceGroupName myRG -Name custom +.Example +Get-AzConnectedMachineExtension -ResourceGroupName contoso-connected-machines -MachineName myMachine | Remove-AzConnectedMachineExtension .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity @@ -3590,44 +3285,60 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. + [SubscriptionId ]: The ID of the target subscription. + [Version ]: The version of the Extension being received. + +MACHINEINPUTOBJECT : Identity Parameter + [ExtensionName ]: The name of the machine extension. + [ExtensionType ]: The extensionType of the Extension being received. + [GroupName ]: The name of the private link resource. + [Id ]: Resource identity path + [LicenseName ]: The name of the license. + [LicenseProfileName ]: The name of the license profile. + [Location ]: The location of the Extension being received. + [MachineName ]: The name of the hybrid machine. + [Name ]: The name of the hybrid machine. + [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection. + [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. + [Publisher ]: The publisher of the Extension being received. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedlicense +https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachineextension #> -function Remove-AzConnectedLicense { +function Remove-AzConnectedMachineExtension { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('LicenseName')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the license. + # The name of the machine where the extension should be deleted. + ${MachineName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [System.String] + # The name of the machine extension. ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] @@ -3651,6 +3362,12 @@ param( # Identity Parameter ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] + # Identity Parameter + ${MachineInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3744,8 +3461,9 @@ begin { } $mapping = @{ - Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedLicense_Delete'; - DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedLicense_DeleteViaIdentity'; + Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_Delete'; + DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentity'; + DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentityMachine'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false @@ -3808,13 +3526,13 @@ end { <# .Synopsis -The operation to delete the extension. +The operation to delete a hybrid machine. .Description -The operation to delete the extension. +The operation to delete a hybrid machine. .Example -Remove-AzConnectedMachineExtension -MachineName myMachine -ResourceGroupName myRG -Name custom +Remove-AzConnectedMachine -Name myMachine -ResourceGroupName myRG .Example -Get-AzConnectedMachineExtension -ResourceGroupName contoso-connected-machines -MachineName myMachine | Remove-AzConnectedMachineExtension +Get-AzConnectedMachine -ResourceGroupName contoso-connected-machines | Remove-AzConnectedMachine .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity @@ -3826,78 +3544,35 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachineextension +https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachine #> -function Remove-AzConnectedMachineExtension { +function Remove-AzConnectedMachine { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('MachineName')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the machine where the extension should be deleted. - ${MachineName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the machine extension. + # The name of the hybrid machine. ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] @@ -3921,12 +3596,6 @@ param( # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${MachineInputObject}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3936,12 +3605,6 @@ param( # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -3962,12 +3625,6 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -4020,9 +3677,8 @@ begin { } $mapping = @{ - Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_Delete'; - DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentity'; - DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentityMachine'; + Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_Delete'; + DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false @@ -4085,11 +3741,11 @@ end { <# .Synopsis -The operation to delete a run command. +Deletes a Azure Arc PrivateLinkScope. .Description -The operation to delete a run command. +Deletes a Azure Arc PrivateLinkScope. .Example -Remove-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand3" -MachineName "testmachine" +Remove-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity @@ -4101,73 +3757,30 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachineruncommand +https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedprivatelinkscope #> -function Remove-AzConnectedMachineRunCommand { +function Remove-AzConnectedPrivateLinkScope { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${MachineName}, - [Parameter(ParameterSetName='Delete', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] @@ -4177,11 +3790,10 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Delete', Mandatory)] - [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the run command. - ${RunCommandName}, + # The name of the Azure Arc PrivateLinkScope resource. + ${ScopeName}, [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] @@ -4196,12 +3808,6 @@ param( # Identity Parameter ${InputObject}, - [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${MachineInputObject}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -4295,9 +3901,8 @@ begin { } $mapping = @{ - Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_Delete'; - DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentity'; - DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentityMachine'; + Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_Delete'; + DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false @@ -4360,473 +3965,16 @@ end { <# .Synopsis -The operation to delete a hybrid machine. +The operation to update a license. .Description -The operation to delete a hybrid machine. -.Example -Remove-AzConnectedMachine -Name myMachine -ResourceGroupName myRG +The operation to update a license. .Example -Get-AzConnectedMachine -ResourceGroupName contoso-connected-machines | Remove-AzConnectedMachine +Set-AzConnectedLicense -Name 'myESULicense' -ResourceGroupName 'ytongtest' -Location 'eastus2euap' -LicenseType 'ESU' -LicenseDetailState 'Deactivated' -LicenseDetailTarget 'Windows Server 2012' -LicenseDetailEdition 'Datacenter' -LicenseDetailType 'pCore' -LicenseDetailProcessor 16 -SubscriptionId ********-****-****-****-********** .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense .Outputs -System.Boolean -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. -.Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachine -#> -function Remove-AzConnectedMachine { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('MachineName')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${Name}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Delete')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_Delete'; - DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_DeleteViaIdentity'; - } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} - -<# -.Synopsis -Deletes a Azure Arc PrivateLinkScope. -.Description -Deletes a Azure Arc PrivateLinkScope. -.Example -Remove-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity -.Outputs -System.Boolean -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. -.Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedprivatelinkscope -#> -function Remove-AzConnectedPrivateLinkScope { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the Azure Arc PrivateLinkScope resource. - ${ScopeName}, - - [Parameter(ParameterSetName='Delete')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_Delete'; - DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_DeleteViaIdentity'; - } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} - -<# -.Synopsis -The operation to update a license. -.Description -The operation to update a license. -.Example -Set-AzConnectedLicense -Name 'myESULicense' -ResourceGroupName 'ytongtest' -Location 'eastus2euap' -LicenseType 'ESU' -LicenseDetailState 'Deactivated' -LicenseDetailTarget 'Windows Server 2012' -LicenseDetailEdition 'Datacenter' -LicenseDetailType 'pCore' -LicenseDetailProcessor 16 -SubscriptionId ********-****-****-****-********** - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense .Notes COMPLEX PARAMETER PROPERTIES @@ -5538,293 +4686,36 @@ param( ${Parameter}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Resource location - ${Location}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Enabled", "Disabled", "SecuredByPerimeter")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. - ${PublicNetworkAccess}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateLinkScopesResourceTags]))] - [System.Collections.Hashtable] - # Resource tags - ${Tag}, - - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Path of Json file supplied to the Update operation - ${JsonFilePath}, - - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Json string supplied to the Update operation - ${JsonString}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Update = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_Update'; - UpdateExpanded = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateExpanded'; - UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonString'; - } - if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} - -<# -.Synopsis -The operation to Upgrade Machine Extensions. -.Description -The operation to Upgrade Machine Extensions. -.Example -$target = @{"Microsoft.Compute.CustomScriptExtension" = @{"targetVersion"="1.10.12"}} -Update-AzConnectedExtension -ResourceGroupName $env.ResourceGroupName -MachineName $machineName -ExtensionTarget $target - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade -.Outputs -System.Boolean -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -EXTENSIONUPGRADEPARAMETER : Describes the Machine Extension Upgrade Properties. - [ExtensionTarget ]: Describes the Extension Target Properties. - [(Any) ]: This indicates any property can be added to this object. - -INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. -.Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedextension -#> -function Update-AzConnectedExtension { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='UpgradeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='UpgradeExpanded', Mandatory)] - [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${MachineName}, - - [Parameter(ParameterSetName='UpgradeExpanded', Mandatory)] - [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='UpgradeExpanded')] - [Parameter(ParameterSetName='UpgradeViaJsonFilePath')] - [Parameter(ParameterSetName='UpgradeViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpgradeViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${InputObject}, + [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] + [System.String] + # Resource location + ${Location}, - [Parameter(ParameterSetName='UpgradeExpanded')] - [Parameter(ParameterSetName='UpgradeViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Enabled", "Disabled", "SecuredByPerimeter")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionTarget]))] - [System.Collections.Hashtable] - # Describes the Extension Target Properties. - ${ExtensionTarget}, + [System.String] + # Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. + ${PublicNetworkAccess}, - [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade] - # Describes the Machine Extension Upgrade Properties. - ${ExtensionUpgradeParameter}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateLinkScopesResourceTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, - [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Path of Json file supplied to the Upgrade operation + # Path of Json file supplied to the Update operation ${JsonFilePath}, - [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Json string supplied to the Upgrade operation + # Json string supplied to the Update operation ${JsonString}, [Parameter()] @@ -5836,12 +4727,6 @@ param( # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -5862,18 +4747,6 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] @@ -5920,13 +4793,12 @@ begin { } $mapping = @{ - UpgradeExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeExpanded'; - UpgradeViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaIdentity'; - UpgradeViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaIdentityExpanded'; - UpgradeViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonFilePath'; - UpgradeViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonString'; + Update = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_Update'; + UpdateExpanded = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonString'; } - if (('UpgradeExpanded', 'UpgradeViaJsonFilePath', 'UpgradeViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { @@ -5987,151 +4859,64 @@ end { <# .Synopsis -The operation to update the extension. +The operation to Upgrade Machine Extensions. .Description -The operation to update the extension. -.Example -$splat = @{ - ResourceGroupName = "connectedMachines" - MachineName = "linux-eastus1_1" - Name = "customScript" - Settings = @{ - commandToExecute = "ls -l" - } -} -Update-AzConnectedMachineExtension @splat -.Example -$extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript -$extToUpdate | Update-AzConnectedMachineExtension -Settings @{ - commandToExecute = "ls -l" -} -.Example -$extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript -# Update the settings on the object that will be used via the pipeline -$extToUpdate.Setting.commandToExecute = "ls -l" -$splat = @{ - ResourceGroupName = "connectedMachines" - MachineName = "linux-eastus1_1" - Name = "customScript" -} -$extToUpdate | Update-AzConnectedMachineExtension @splat +The operation to Upgrade Machine Extensions. .Example -$extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript -# Update the settings on the object that will be used via the pipeline -$extToUpdate.Setting.commandToExecute = "ls -l" -$extToUpdate | Update-AzConnectedMachineExtension -ExtensionParameter $extToUpdate +$target = @{"Microsoft.Compute.CustomScriptExtension" = @{"targetVersion"="1.10.12"}} +Update-AzConnectedExtension -ResourceGroupName $env.ResourceGroupName -MachineName $machineName -ExtensionTarget $target .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension +System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -EXTENSIONPARAMETER : Describes a Machine Extension Update. - [Tags ]: Resource tags - [(Any) ]: This indicates any property can be added to this object. - [AutoUpgradeMinorVersion ]: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - [EnableAutomaticUpgrade ]: Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - [ForceUpdateTag ]: How the extension handler should be forced to update even if the extension configuration has not changed. - [ProtectedSetting ]: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - [(Any) ]: This indicates any property can be added to this object. - [Publisher ]: The name of the extension handler publisher. - [Setting ]: Json formatted public settings for the extension. - [(Any) ]: This indicates any property can be added to this object. - [Type ]: Specifies the type of the extension; an example is "CustomScriptExtension". - [TypeHandlerVersion ]: Specifies the version of the script handler. +EXTENSIONUPGRADEPARAMETER : Describes the Machine Extension Upgrade Properties. + [ExtensionTarget ]: Describes the Extension Target Properties. + [(Any) ]: This indicates any property can be added to this object. INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedmachineextension +https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedextension #> -function Update-AzConnectedMachineExtension { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzConnectedExtension { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='UpgradeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Update', Mandatory)] - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpgradeExpanded', Mandatory)] + [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the machine where the extension should be created or updated. + # The name of the hybrid machine. ${MachineName}, - [Parameter(ParameterSetName='Update', Mandatory)] - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the machine extension. - ${Name}, - - [Parameter(ParameterSetName='Update', Mandatory)] - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpgradeExpanded', Mandatory)] + [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] @@ -6139,126 +4924,46 @@ param( # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Update')] - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaJsonFilePath')] - [Parameter(ParameterSetName='UpdateViaJsonString')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${MachineInputObject}, - - [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate] - # Describes a Machine Extension Update. - ${ExtensionParameter}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Indicates whether the extension should use a newer minor version if one is available at deployment time. - # Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - ${AutoUpgradeMinorVersion}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - ${EnableAutomaticUpgrade}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # How the extension handler should be forced to update even if the extension configuration has not changed. - ${ForceRerun}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Alias('ProtectedSettings')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdatePropertiesProtectedSettings]))] - [System.Collections.Hashtable] - # The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ${ProtectedSetting}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # The name of the extension handler publisher. - ${Publisher}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Alias('Settings')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdatePropertiesSettings]))] - [System.Collections.Hashtable] - # Json formatted public settings for the extension. - ${Setting}, + [Parameter(ParameterSetName='UpgradeExpanded')] + [Parameter(ParameterSetName='UpgradeViaJsonFilePath')] + [Parameter(ParameterSetName='UpgradeViaJsonString')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags]))] - [System.Collections.Hashtable] - # Resource tags - ${Tag}, + [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpgradeViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] + # Identity Parameter + ${InputObject}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] + [Parameter(ParameterSetName='UpgradeExpanded')] + [Parameter(ParameterSetName='UpgradeViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the type of the extension; an example is "CustomScriptExtension". - ${Type}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionTarget]))] + [System.Collections.Hashtable] + # Describes the Extension Target Properties. + ${ExtensionTarget}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] + [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the version of the script handler. - ${TypeHandlerVersion}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade] + # Describes the Machine Extension Upgrade Properties. + ${ExtensionUpgradeParameter}, - [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Path of Json file supplied to the Update operation + # Path of Json file supplied to the Upgrade operation ${JsonFilePath}, - [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Json string supplied to the Update operation + # Json string supplied to the Upgrade operation ${JsonString}, [Parameter()] @@ -6302,6 +5007,12 @@ param( # Run the command asynchronously ${NoWait}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] @@ -6348,16 +5059,13 @@ begin { } $mapping = @{ - Update = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_Update'; - UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateExpanded'; - UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentity'; - UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityExpanded'; - UpdateViaIdentityMachine = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityMachine'; - UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityMachineExpanded'; - UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonFilePath'; - UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonString'; + UpgradeExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeExpanded'; + UpgradeViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaIdentity'; + UpgradeViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaIdentityExpanded'; + UpgradeViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonFilePath'; + UpgradeViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonString'; } - if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + if (('UpgradeExpanded', 'UpgradeViaJsonFilePath', 'UpgradeViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { @@ -6418,145 +5126,144 @@ end { <# .Synopsis -The operation to update a run command. +The operation to update the extension. .Description -The operation to update a run command. +The operation to update the extension. .Example -Update-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand3" -MachineName "testmachine" -SubscriptionId ********-****-****-****-********** -Tag @{Tag1="tag1"; Tag2="tag2"} - +$splat = @{ + ResourceGroupName = "connectedMachines" + MachineName = "linux-eastus1_1" + Name = "customScript" + Settings = @{ + commandToExecute = "ls -l" + } +} +Update-AzConnectedMachineExtension @splat +.Example +$extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript +$extToUpdate | Update-AzConnectedMachineExtension -Settings @{ + commandToExecute = "ls -l" +} +.Example +$extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript +# Update the settings on the object that will be used via the pipeline +$extToUpdate.Setting.commandToExecute = "ls -l" +$splat = @{ + ResourceGroupName = "connectedMachines" + MachineName = "linux-eastus1_1" + Name = "customScript" +} +$extToUpdate | Update-AzConnectedMachineExtension @splat +.Example +$extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript +# Update the settings on the object that will be used via the pipeline +$extToUpdate.Setting.commandToExecute = "ls -l" +$extToUpdate | Update-AzConnectedMachineExtension -ExtensionParameter $extToUpdate .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand +Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension .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. +EXTENSIONPARAMETER : Describes a Machine Extension Update. + [Tags ]: Resource tags + [(Any) ]: This indicates any property can be added to this object. + [AutoUpgradeMinorVersion ]: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + [EnableAutomaticUpgrade ]: Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + [ForceUpdateTag ]: How the extension handler should be forced to update even if the extension configuration has not changed. + [ProtectedSetting ]: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + [(Any) ]: This indicates any property can be added to this object. + [Publisher ]: The name of the extension handler publisher. + [Setting ]: Json formatted public settings for the extension. + [(Any) ]: This indicates any property can be added to this object. + [Type ]: Specifies the type of the extension; an example is "CustomScriptExtension". + [TypeHandlerVersion ]: Specifies the version of the script handler. + INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. - -PARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -PROTECTEDPARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -RUNCOMMANDPROPERTY : Describes a Run Command - Location : The geo-location where the resource lives - [Tags ]: Resource tags. - [(Any) ]: This indicates any property can be added to this object. - [AsyncExecution ]: Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - [ErrorBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ErrorBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [ErrorBlobUri ]: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - [OutputBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [OutputBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [OutputBlobUri ]: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - [Parameter >]: The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - [ProtectedParameter >]: The parameters used by the script. - [RunAsPassword ]: Specifies the user account password on the machine when executing the run command. - [RunAsUser ]: Specifies the user account on the machine when executing the run command. - [ScriptUriManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ScriptUriManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [SourceCommandId ]: Specifies the commandId of predefined built-in script. - [SourceScript ]: Specifies the script content to be executed on the machine. - [SourceScriptUri ]: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - [TimeoutInSecond ]: The timeout in seconds to execute the run command. .Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedmachineruncommand +https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedmachineextension #> -function Update-AzConnectedMachineRunCommand { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] +function Update-AzConnectedMachineExtension { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the hybrid machine. + # The name of the machine where the extension should be created or updated. ${MachineName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] + [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, + # The name of the machine extension. + ${Name}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] - # The name of the run command. - ${RunCommandName}, + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -6581,168 +5288,99 @@ param( [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand] - # Describes a Run Command - ${RunCommandProperty}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate] + # Describes a Machine Extension Update. + ${ExtensionParameter}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] - # Optional. - # If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - ${AsyncExecution}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ErrorBlobManagedIdentityClientId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ErrorBlobManagedIdentityObjectId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the Azure storage blob where script error stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer errorBlobManagedIdentity parameter. - ${ErrorBlobUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${OutputBlobManagedIdentityClientId}, + # Indicates whether the extension should use a newer minor version if one is available at deployment time. + # Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + ${AutoUpgradeMinorVersion}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${OutputBlobManagedIdentityObjectId}, + [System.Management.Automation.SwitchParameter] + # Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + ${EnableAutomaticUpgrade}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Specifies the Azure storage blob where script output stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer outputBlobManagedIdentity parameter. - ${OutputBlobUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${Parameter}, + # How the extension handler should be forced to update even if the extension configuration has not changed. + ${ForceRerun}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [AllowEmptyCollection()] + [Alias('ProtectedSettings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${ProtectedParameter}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdatePropertiesProtectedSettings]))] + [System.Collections.Hashtable] + # The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + ${ProtectedSetting}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Specifies the user account password on the machine when executing the run command. - ${RunAsPassword}, + # The name of the extension handler publisher. + ${Publisher}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] + [Alias('Settings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the user account on the machine when executing the run command. - ${RunAsUser}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdatePropertiesSettings]))] + [System.Collections.Hashtable] + # Json formatted public settings for the extension. + ${Setting}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ScriptUriManagedIdentityClientId}, + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags]))] + [System.Collections.Hashtable] + # Resource tags + ${Tag}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ScriptUriManagedIdentityObjectId}, + # Specifies the type of the extension; an example is "CustomScriptExtension". + ${Type}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Specifies the commandId of predefined built-in script. - ${SourceCommandId}, + # Specifies the version of the script handler. + ${TypeHandlerVersion}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Specifies the script content to be executed on the machine. - ${SourceScript}, + # Path of Json file supplied to the Update operation + ${JsonFilePath}, - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] - # Specifies the script download location. - # It can be either SAS URI of an Azure storage blob with read access or public URI. - ${SourceScriptUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Int32] - # The timeout in seconds to execute the run command. - ${TimeoutInSecond}, + # Json string supplied to the Update operation + ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -6831,14 +5469,16 @@ begin { } $mapping = @{ - Update = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_Update'; - UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateExpanded'; - UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentity'; - UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityExpanded'; - UpdateViaIdentityMachine = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachine'; - UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded'; - } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + Update = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_Update'; + UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateExpanded'; + UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentity'; + UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityExpanded'; + UpdateViaIdentityMachine = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityMachine'; + UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityMachineExpanded'; + UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonString'; + } + if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { @@ -6920,30 +5560,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. @@ -7521,30 +6152,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedLicense.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedLicense.ps1 index 1d1db6be9b25..828ea2660e0c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedLicense.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedLicense.ps1 @@ -32,30 +32,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 index 71586c602b87..6f56eb7ffb54 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachine.ps1 @@ -34,30 +34,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 index c9b192bf383b..0ab779176604 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedMachineExtension.ps1 @@ -34,58 +34,40 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 index 28d6e3cdcdc6..a66bc1affc57 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Remove-AzConnectedPrivateLinkScope.ps1 @@ -32,30 +32,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 index 72433a2c3bfd..bf1c208b8e6c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedExtension.ps1 @@ -39,30 +39,21 @@ EXTENSIONUPGRADEPARAMETER : Describes the Machine Exte [(Any) ]: This indicates any property can be added to this object. INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 index 9aaa24b37319..d5719900882a 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachine.ps1 @@ -34,30 +34,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 index 24b36a8503d5..35838addb8a3 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineExtension.ps1 @@ -76,58 +76,40 @@ EXTENSIONPARAMETER : Describes a Machine Extension Upda [TypeHandlerVersion ]: Specifies the version of the script handler. INPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. .Link diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineRunCommand.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineRunCommand.ps1 deleted file mode 100644 index 4b5eb1e5acfa..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedMachineRunCommand.ps1 +++ /dev/null @@ -1,496 +0,0 @@ - -# ---------------------------------------------------------------------------------- -# 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 -The operation to update a run command. -.Description -The operation to update a run command. -.Example -Update-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand3" -MachineName "testmachine" -SubscriptionId ********-****-****-****-********** -Tag @{Tag1="tag1"; Tag2="tag2"} - - -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand -.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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -MACHINEINPUTOBJECT : Identity Parameter - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. - [ExtensionName ]: The name of the machine extension. - [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. - [GroupName ]: The name of the private link resource. - [Id ]: Resource identity path - [LicenseName ]: The name of the license. - [LicenseProfileName ]: The name of the license profile. - [Location ]: The location of the Extension being received. - [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. - [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. - [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. - [PrivateEndpointConnectionName ]: The name of the private endpoint connection. - [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. - [Publisher ]: The publisher of the Extension being received. - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. - [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. - [SubscriptionId ]: The ID of the target subscription. - [Version ]: The version of the Extension being received. - -PARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -PROTECTEDPARAMETER : The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - -RUNCOMMANDPROPERTY : Describes a Run Command - Location : The geo-location where the resource lives - [Tags ]: Resource tags. - [(Any) ]: This indicates any property can be added to this object. - [AsyncExecution ]: Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - [ErrorBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ErrorBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [ErrorBlobUri ]: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - [OutputBlobManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [OutputBlobManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [OutputBlobUri ]: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - [Parameter >]: The parameters used by the script. - Name : The run command parameter name. - Value : The run command parameter value. - [ProtectedParameter >]: The parameters used by the script. - [RunAsPassword ]: Specifies the user account password on the machine when executing the run command. - [RunAsUser ]: Specifies the user account on the machine when executing the run command. - [ScriptUriManagedIdentityClientId ]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [ScriptUriManagedIdentityObjectId ]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [SourceCommandId ]: Specifies the commandId of predefined built-in script. - [SourceScript ]: Specifies the script content to be executed on the machine. - [SourceScriptUri ]: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - [TimeoutInSecond ]: The timeout in seconds to execute the run command. -.Link -https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedmachineruncommand -#> -function Update-AzConnectedMachineRunCommand { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Update', Mandatory)] - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the hybrid machine. - ${MachineName}, - - [Parameter(ParameterSetName='Update', Mandatory)] - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter(ParameterSetName='Update', Mandatory)] - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory)] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [System.String] - # The name of the run command. - ${RunCommandName}, - - [Parameter(ParameterSetName='Update')] - [Parameter(ParameterSetName='UpdateExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${InputObject}, - - [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] - # Identity Parameter - ${MachineInputObject}, - - [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand] - # Describes a Run Command - ${RunCommandProperty}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Management.Automation.SwitchParameter] - # Optional. - # If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - ${AsyncExecution}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ErrorBlobManagedIdentityClientId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ErrorBlobManagedIdentityObjectId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the Azure storage blob where script error stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer errorBlobManagedIdentity parameter. - ${ErrorBlobUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${OutputBlobManagedIdentityClientId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${OutputBlobManagedIdentityObjectId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the Azure storage blob where script output stream will be uploaded. - # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. - # Refer outputBlobManagedIdentity parameter. - ${OutputBlobUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${Parameter}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] - # The parameters used by the script. - ${ProtectedParameter}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the user account password on the machine when executing the run command. - ${RunAsPassword}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the user account on the machine when executing the run command. - ${RunAsUser}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Client Id (GUID value) of the user-assigned managed identity. - # ObjectId should not be used if this is provided. - ${ScriptUriManagedIdentityClientId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Object Id (GUID value) of the user-assigned managed identity. - # ClientId should not be used if this is provided. - ${ScriptUriManagedIdentityObjectId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the commandId of predefined built-in script. - ${SourceCommandId}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the script content to be executed on the machine. - ${SourceScript}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.String] - # Specifies the script download location. - # It can be either SAS URI of an Azure storage blob with read access or public URI. - ${SourceScriptUri}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, - - [Parameter(ParameterSetName='UpdateExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] - [System.Int32] - # The timeout in seconds to execute the run command. - ${TimeoutInSecond}, - - [Parameter()] - [Alias('AzureRMContext', 'AzureCredential')] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] - [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. - ${DefaultProfile}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Wait for .NET debugger to attach - ${Break}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be appended to the front of the pipeline - ${HttpPipelineAppend}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] - # SendAsync Pipeline Steps to be prepended to the front of the pipeline - ${HttpPipelinePrepend}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Uri] - # The URI for the proxy server to use - ${Proxy}, - - [Parameter(DontShow)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.PSCredential] - # Credentials for a proxy server to use for the remote call - ${ProxyCredential}, - - [Parameter(DontShow)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Use the default credentials for the proxy - ${ProxyUseDefaultCredentials} -) - -begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - $parameterSet = $PSCmdlet.ParameterSetName - - if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() - } - $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - if ($preTelemetryId -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) - } else { - $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - if ($internalCalledCmdlets -eq '') { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name - } else { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' - } - - $mapping = @{ - Update = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_Update'; - UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateExpanded'; - UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentity'; - UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityExpanded'; - UpdateViaIdentityMachine = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachine'; - UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded'; - } - if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } - if ($testPlayback) { - $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') - } else { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id - } - } - $cmdInfo = Get-Command -Name $mapping[$parameterSet] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) - } - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) - $scriptCmd = {& $wrappedCmd @PSBoundParameters} - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} - -process { - try { - $steppablePipeline.Process($_) - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } - - finally { - $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId - $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - -} -end { - try { - $steppablePipeline.End() - - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets - if ($preTelemetryId -eq '') { - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - } - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId - - } catch { - [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() - throw - } -} -} diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 index 177ab8617b47..0cd9487b5c9f 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/exports/Update-AzConnectedPrivateLinkScopeTag.ps1 @@ -37,30 +37,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generate-info.json b/generated/ConnectedMachine/ConnectedMachine.Autorest/generate-info.json index 5a0ed4ac25d4..5a2d38def961 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generate-info.json +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "7081b46f-50e7-4430-93fd-31c54c5dcab2" + "generate_Id": "52e9197c-79b3-4ba0-96bd-f2d8a18eace7" } diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/ConnectedMachine.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/ConnectedMachine.cs index 23b4fd884866..d781d4bf2e53 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/ConnectedMachine.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/ConnectedMachine.cs @@ -14,9 +14,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine public partial class ConnectedMachine { - /// Gets an Agent Version along with the download link currently present. - /// Defines the os type - /// Defines the agent version. To get latest, use latest or else a specific agent version. + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. /// a delegate that is 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). @@ -25,17 +30,23 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentVersionGet(string osType, string version, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataGet(string subscriptionId, string location, string publisher, string extensionType, string version, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + global::System.Uri.EscapeDataString(osType) - + "/agentVersions/" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/locations/" + + global::System.Uri.EscapeDataString(location) + + "/publishers/" + + global::System.Uri.EscapeDataString(publisher) + + "/extensionTypes/" + + global::System.Uri.EscapeDataString(extensionType) + + "/versions/" + global::System.Uri.EscapeDataString(version) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) @@ -50,11 +61,13 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentVersionGet_Call (request, onOk,onDefault,eventListener,sender); + await this.ExtensionMetadataGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets an Agent Version along with the download link currently present. + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -64,28 +77,37 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentVersionGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/osType/(?[^/]+)/agentVersions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions/{version}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}'"); } // replace URI parameters with values from identity - var osType = _match.Groups["osType"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var publisher = _match.Groups["publisher"].Value; + var extensionType = _match.Groups["extensionType"].Value; var version = _match.Groups["version"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + osType - + "/agentVersions/" + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.HybridCompute/locations/" + + location + + "/publishers/" + + publisher + + "/extensionTypes/" + + extensionType + + "/versions/" + version + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) @@ -100,40 +122,51 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentVersionGet_Call (request, onOk,onDefault,eventListener,sender); + await this.ExtensionMetadataGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets an Agent Version along with the download link currently present. + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 AgentVersionGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/osType/(?[^/]+)/agentVersions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions/{version}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}'"); } // replace URI parameters with values from identity - var osType = _match.Groups["osType"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var publisher = _match.Groups["publisher"].Value; + var extensionType = _match.Groups["extensionType"].Value; var version = _match.Groups["version"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + osType - + "/agentVersions/" + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.HybridCompute/locations/" + + location + + "/publishers/" + + publisher + + "/extensionTypes/" + + extensionType + + "/versions/" + version + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) @@ -148,30 +181,41 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.AgentVersionGetWithResult_Call (request, eventListener,sender); + return await this.ExtensionMetadataGetWithResult_Call (request, eventListener,sender); } } - /// Gets an Agent Version along with the download link currently present. - /// Defines the os type - /// Defines the agent version. To get latest, use latest or else a specific agent version. + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 AgentVersionGetWithResult(string osType, string version, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataGetWithResult(string subscriptionId, string location, string publisher, string extensionType, string version, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + global::System.Uri.EscapeDataString(osType) - + "/agentVersions/" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/locations/" + + global::System.Uri.EscapeDataString(location) + + "/publishers/" + + global::System.Uri.EscapeDataString(publisher) + + "/extensionTypes/" + + global::System.Uri.EscapeDataString(extensionType) + + "/versions/" + global::System.Uri.EscapeDataString(version) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) @@ -186,19 +230,19 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.AgentVersionGetWithResult_Call (request, eventListener,sender); + return await this.ExtensionMetadataGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 AgentVersionGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ExtensionMetadataGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -217,7 +261,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersion.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValue.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -250,7 +294,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -260,7 +304,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentVersionGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ExtensionMetadataGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -279,7 +323,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersion.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValue.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -301,26 +345,36 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// Defines the os type - /// Defines the agent version. To get latest, use latest or else a specific agent version. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. /// 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 AgentVersionGet_Validate(string osType, string version, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ExtensionMetadataGet_Validate(string subscriptionId, string location, string publisher, string extensionType, string version, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(osType),osType); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(publisher),publisher); + await eventListener.AssertNotNull(nameof(extensionType),extensionType); await eventListener.AssertNotNull(nameof(version),version); } } - /// Gets all Agent Versions along with the download link currently present. - /// Defines the os type. + /// Gets all Extension versions based on location, publisher, extensionType + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. /// a delegate that is 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). @@ -329,17 +383,23 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentVersionList(string osType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataList(string subscriptionId, string location, string publisher, string extensionType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + global::System.Uri.EscapeDataString(osType) - + "/agentVersions" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/locations/" + + global::System.Uri.EscapeDataString(location) + + "/publishers/" + + global::System.Uri.EscapeDataString(publisher) + + "/extensionTypes/" + + global::System.Uri.EscapeDataString(extensionType) + + "/versions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -353,11 +413,11 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentVersionList_Call (request, onOk,onDefault,eventListener,sender); + await this.ExtensionMetadataList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets all Agent Versions along with the download link currently present. + /// Gets all Extension versions based on location, publisher, extensionType /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -367,27 +427,36 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentVersionListViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataListViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/osType/(?[^/]+)/agentVersions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions'"); } // replace URI parameters with values from identity - var osType = _match.Groups["osType"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var publisher = _match.Groups["publisher"].Value; + var extensionType = _match.Groups["extensionType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + osType - + "/agentVersions" + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.HybridCompute/locations/" + + location + + "/publishers/" + + publisher + + "/extensionTypes/" + + extensionType + + "/versions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -401,39 +470,48 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentVersionList_Call (request, onOk,onDefault,eventListener,sender); + await this.ExtensionMetadataList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets all Agent Versions along with the download link currently present. + /// Gets all Extension versions based on location, publisher, extensionType /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 AgentVersionListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/osType/(?[^/]+)/agentVersions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/osType/{osType}/agentVersions'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions'"); } // replace URI parameters with values from identity - var osType = _match.Groups["osType"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var publisher = _match.Groups["publisher"].Value; + var extensionType = _match.Groups["extensionType"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + osType - + "/agentVersions" + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.HybridCompute/locations/" + + location + + "/publishers/" + + publisher + + "/extensionTypes/" + + extensionType + + "/versions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -447,29 +525,38 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.AgentVersionListWithResult_Call (request, eventListener,sender); + return await this.ExtensionMetadataListWithResult_Call (request, eventListener,sender); } } - /// Gets all Agent Versions along with the download link currently present. - /// Defines the os type. + /// Gets all Extension versions based on location, publisher, extensionType + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 AgentVersionListWithResult(string osType, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExtensionMetadataListWithResult(string subscriptionId, string location, string publisher, string extensionType, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/osType/" - + global::System.Uri.EscapeDataString(osType) - + "/agentVersions" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/locations/" + + global::System.Uri.EscapeDataString(location) + + "/publishers/" + + global::System.Uri.EscapeDataString(publisher) + + "/extensionTypes/" + + global::System.Uri.EscapeDataString(extensionType) + + "/versions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -483,19 +570,19 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.AgentVersionListWithResult_Call (request, eventListener,sender); + return await this.ExtensionMetadataListWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 AgentVersionListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ExtensionMetadataListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -514,7 +601,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersionsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValueListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -547,7 +634,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -557,7 +644,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentVersionList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ExtensionMetadataList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -576,7 +663,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersionsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValueListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -598,41 +685,47 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// Defines the os type. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. /// 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 AgentVersionList_Validate(string osType, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ExtensionMetadataList_Validate(string subscriptionId, string location, string publisher, string extensionType, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(osType),osType); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(publisher),publisher); + await eventListener.AssertNotNull(nameof(extensionType),extensionType); } } - /// - /// Gets an Extension Metadata based on location, publisher, extensionType and version - /// + /// The operation to update a license profile. /// The ID of the target subscription. - /// The location of the Extension being received. - /// The publisher of the Extension being received. - /// The extensionType of the Extension being received. - /// The version of the Extension being received. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Parameters supplied to the Create or Update license profile operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExtensionMetadataGet(string subscriptionId, string location, string publisher, string extensionType, string version, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -640,14 +733,12 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/locations/" - + global::System.Uri.EscapeDataString(location) - + "/publishers/" - + global::System.Uri.EscapeDataString(publisher) - + "/extensionTypes/" - + global::System.Uri.EscapeDataString(extensionType) - + "/versions/" - + global::System.Uri.EscapeDataString(version) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -656,118 +747,120 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExtensionMetadataGet_Call (request, onOk,onDefault,eventListener,sender); + await this.LicenseProfilesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Gets an Extension Metadata based on location, publisher, extensionType and version - /// + /// The operation to update a license profile. /// + /// Parameters supplied to the Create or Update license profile operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExtensionMetadataGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var publisher = _match.Groups["publisher"].Value; - var extensionType = _match.Groups["extensionType"].Value; - var version = _match.Groups["version"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + var licenseProfileName = _match.Groups["licenseProfileName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.HybridCompute/locations/" - + location - + "/publishers/" - + publisher - + "/extensionTypes/" - + extensionType - + "/versions/" - + version - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/licenseProfiles/" + + licenseProfileName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ExtensionMetadataGet_Call (request, onOk,onDefault,eventListener,sender); + await this.LicenseProfilesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Gets an Extension Metadata based on location, publisher, extensionType and version - /// + /// The operation to update a license profile. /// + /// Parameters supplied to the Create or Update license profile operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExtensionMetadataGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var publisher = _match.Groups["publisher"].Value; - var extensionType = _match.Groups["extensionType"].Value; - var version = _match.Groups["version"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + var licenseProfileName = _match.Groups["licenseProfileName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.HybridCompute/locations/" - + location - + "/publishers/" - + publisher - + "/extensionTypes/" - + extensionType - + "/versions/" - + version + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/licenseProfiles/" + + licenseProfileName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -776,32 +869,85 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.ExtensionMetadataGetWithResult_Call (request, eventListener,sender); + return await this.LicenseProfilesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Gets an Extension Metadata based on location, publisher, extensionType and version - /// + /// The operation to update a license profile. /// The ID of the target subscription. - /// The location of the Extension being received. - /// The publisher of the Extension being received. - /// The extensionType of the Extension being received. - /// The version of the Extension being received. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Json string supplied to the LicenseProfilesCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicenseProfilesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update a license profile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Json string supplied to the LicenseProfilesCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 ExtensionMetadataGetWithResult(string subscriptionId, string location, string publisher, string extensionType, string version, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -809,14 +955,12 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/locations/" - + global::System.Uri.EscapeDataString(location) - + "/publishers/" - + global::System.Uri.EscapeDataString(publisher) - + "/extensionTypes/" - + global::System.Uri.EscapeDataString(extensionType) - + "/versions/" - + global::System.Uri.EscapeDataString(version) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -825,86 +969,80 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.ExtensionMetadataGetWithResult_Call (request, eventListener,sender); + return await this.LicenseProfilesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// The operation to update a license profile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Parameters supplied to the Create or Update license profile operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExtensionMetadataGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValue.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicenseProfilesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExtensionMetadataGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -912,8397 +1050,13 @@ public partial class ConnectedMachine try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValue.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 location of the Extension being received. - /// The publisher of the Extension being received. - /// The extensionType of the Extension being received. - /// The version of the Extension being received. - /// 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 ExtensionMetadataGet_Validate(string subscriptionId, string location, string publisher, string extensionType, string version, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertNotNull(nameof(publisher),publisher); - await eventListener.AssertNotNull(nameof(extensionType),extensionType); - await eventListener.AssertNotNull(nameof(version),version); - } - } - - /// Gets all Extension versions based on location, publisher, extensionType - /// The ID of the target subscription. - /// The location of the Extension being received. - /// The publisher of the Extension being received. - /// The extensionType of the Extension being received. - /// a delegate that is 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.ConnectedMachine.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 ExtensionMetadataList(string subscriptionId, string location, string publisher, string extensionType, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/locations/" - + global::System.Uri.EscapeDataString(location) - + "/publishers/" - + global::System.Uri.EscapeDataString(publisher) - + "/extensionTypes/" - + global::System.Uri.EscapeDataString(extensionType) - + "/versions" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ExtensionMetadataList_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Gets all Extension versions based on location, publisher, extensionType - /// - /// a delegate that is 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.ConnectedMachine.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 ExtensionMetadataListViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var publisher = _match.Groups["publisher"].Value; - var extensionType = _match.Groups["extensionType"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.HybridCompute/locations/" - + location - + "/publishers/" - + publisher - + "/extensionTypes/" - + extensionType - + "/versions" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ExtensionMetadataList_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Gets all Extension versions based on location, publisher, extensionType - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 ExtensionMetadataListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/locations/(?[^/]+)/publishers/(?[^/]+)/extensionTypes/(?[^/]+)/versions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var publisher = _match.Groups["publisher"].Value; - var extensionType = _match.Groups["extensionType"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.HybridCompute/locations/" - + location - + "/publishers/" - + publisher - + "/extensionTypes/" - + extensionType - + "/versions" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.ExtensionMetadataListWithResult_Call (request, eventListener,sender); - } - } - - /// Gets all Extension versions based on location, publisher, extensionType - /// The ID of the target subscription. - /// The location of the Extension being received. - /// The publisher of the Extension being received. - /// The extensionType of the Extension being received. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 ExtensionMetadataListWithResult(string subscriptionId, string location, string publisher, string extensionType, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/locations/" - + global::System.Uri.EscapeDataString(location) - + "/publishers/" - + global::System.Uri.EscapeDataString(publisher) - + "/extensionTypes/" - + global::System.Uri.EscapeDataString(extensionType) - + "/versions" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.ExtensionMetadataListWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 ExtensionMetadataListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValueListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 ExtensionMetadataList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionValueListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 location of the Extension being received. - /// The publisher of the Extension being received. - /// The extensionType of the Extension being received. - /// 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 ExtensionMetadataList_Validate(string subscriptionId, string location, string publisher, string extensionType, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertNotNull(nameof(publisher),publisher); - await eventListener.AssertNotNull(nameof(extensionType),extensionType); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Create gateway operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysCreateOrUpdate(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a gateway. - /// - /// Parameters supplied to the Create gateway operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/(?[^/]+)$", 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.HybridCompute/gateways/{gatewayName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var gatewayName = _match.Groups["gatewayName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/gateways/" - + gatewayName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a gateway. - /// - /// Parameters supplied to the Create gateway operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/(?[^/]+)$", 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.HybridCompute/gateways/{gatewayName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var gatewayName = _match.Groups["gatewayName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/gateways/" - + gatewayName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Json string supplied to the GatewaysCreateOrUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string gatewayName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Json string supplied to the GatewaysCreateOrUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string gatewayName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Create gateway operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the Gateway. - /// Parameters supplied to the Create gateway operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task GatewaysCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(gatewayName),gatewayName); - await eventListener.AssertRegEx(nameof(gatewayName), gatewayName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// The operation to delete a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is 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.ConnectedMachine.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 GatewaysDelete(string subscriptionId, string resourceGroupName, string gatewayName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); - } - } - - /// The operation to delete a gateway. - /// - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is 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.ConnectedMachine.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 GatewaysDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/(?[^/]+)$", 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.HybridCompute/gateways/{gatewayName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var gatewayName = _match.Groups["gatewayName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/gateways/" - + gatewayName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is 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.ConnectedMachine.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 GatewaysDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the Gateway. - /// 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 GatewaysDelete_Validate(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(gatewayName),gatewayName); - await eventListener.AssertRegEx(nameof(gatewayName), gatewayName, @"[a-zA-Z0-9-_\.]+"); - } - } - - /// Retrieves information about the view of a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// a delegate that is 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.ConnectedMachine.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 GatewaysGet(string subscriptionId, string resourceGroupName, string gatewayName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Retrieves information about the view of a gateway. - /// - /// a delegate that is 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.ConnectedMachine.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 GatewaysGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/(?[^/]+)$", 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.HybridCompute/gateways/{gatewayName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var gatewayName = _match.Groups["gatewayName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/gateways/" - + gatewayName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Retrieves information about the view of a gateway. - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/(?[^/]+)$", 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.HybridCompute/gateways/{gatewayName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var gatewayName = _match.Groups["gatewayName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/gateways/" - + gatewayName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysGetWithResult_Call (request, eventListener,sender); - } - } - - /// Retrieves information about the view of a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysGetWithResult(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysGetWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the Gateway. - /// 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 GatewaysGet_Validate(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(gatewayName),gatewayName); - await eventListener.AssertRegEx(nameof(gatewayName), gatewayName, @"[a-zA-Z0-9-_\.]+"); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// 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.ConnectedMachine.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 GatewaysListByResourceGroup(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// - /// a delegate that is 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.ConnectedMachine.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 GatewaysListByResourceGroupViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways$", 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.HybridCompute/gateways'"); - } - - // 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.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways$", 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.HybridCompute/gateways'"); - } - - // 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.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysListByResourceGroupWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysListByResourceGroupWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewaysListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListByResourceGroup_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewaysListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// 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.ConnectedMachine.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 GatewaysListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysListBySubscription_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// - /// a delegate that is 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.ConnectedMachine.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 GatewaysListBySubscriptionViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways'"); - } - - // 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.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysListBySubscription_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways'"); - } - - // 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.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysListBySubscriptionWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to get all gateways of a non-Azure machine - /// The ID of the target subscription. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/gateways" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysListBySubscriptionWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewaysListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListBySubscription_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewaysListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Update gateway operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysUpdate(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a gateway. - /// - /// Parameters supplied to the Update gateway operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/(?[^/]+)$", 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.HybridCompute/gateways/{gatewayName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var gatewayName = _match.Groups["gatewayName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/gateways/" - + gatewayName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a gateway. - /// - /// Parameters supplied to the Update gateway operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/(?[^/]+)$", 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.HybridCompute/gateways/{gatewayName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var gatewayName = _match.Groups["gatewayName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/gateways/" - + gatewayName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Json string supplied to the GatewaysUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysUpdateViaJsonString(string subscriptionId, string resourceGroupName, string gatewayName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GatewaysUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Json string supplied to the GatewaysUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string gatewayName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Update gateway operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GatewaysUpdateWithResult(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/gateways/" - + global::System.Uri.EscapeDataString(gatewayName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.GatewaysUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 GatewaysUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponseAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the Gateway. - /// Parameters supplied to the Update gateway operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task GatewaysUpdate_Validate(string subscriptionId, string resourceGroupName, string gatewayName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(gatewayName),gatewayName); - await eventListener.AssertRegEx(nameof(gatewayName), gatewayName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Implements HybridIdentityMetadata GET method. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Name of the HybridIdentityMetadata. - /// a delegate that is 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.ConnectedMachine.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 HybridIdentityMetadataGet(string subscriptionId, string resourceGroupName, string machineName, string metadataName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/hybridIdentityMetadata/" - + global::System.Uri.EscapeDataString(metadataName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.HybridIdentityMetadataGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Implements HybridIdentityMetadata GET method. - /// - /// a delegate that is 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.ConnectedMachine.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 HybridIdentityMetadataGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/hybridIdentityMetadata/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/hybridIdentityMetadata/{metadataName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var metadataName = _match.Groups["metadataName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/hybridIdentityMetadata/" - + metadataName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.HybridIdentityMetadataGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Implements HybridIdentityMetadata GET method. - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/hybridIdentityMetadata/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/hybridIdentityMetadata/{metadataName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var metadataName = _match.Groups["metadataName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/hybridIdentityMetadata/" - + metadataName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.HybridIdentityMetadataGetWithResult_Call (request, eventListener,sender); - } - } - - /// Implements HybridIdentityMetadata GET method. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Name of the HybridIdentityMetadata. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataGetWithResult(string subscriptionId, string resourceGroupName, string machineName, string metadataName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/hybridIdentityMetadata/" - + global::System.Uri.EscapeDataString(metadataName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.HybridIdentityMetadataGetWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadata.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadata.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the hybrid machine. - /// Name of the HybridIdentityMetadata. - /// 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 HybridIdentityMetadataGet_Validate(string subscriptionId, string resourceGroupName, string machineName, string metadataName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(metadataName),metadataName); - await eventListener.AssertRegEx(nameof(metadataName), metadataName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - } - } - - /// Returns the list of HybridIdentityMetadata of the given machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// a delegate that is 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.ConnectedMachine.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 HybridIdentityMetadataListByMachines(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/hybridIdentityMetadata" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.HybridIdentityMetadataListByMachines_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Returns the list of HybridIdentityMetadata of the given machine. - /// - /// a delegate that is 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.ConnectedMachine.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 HybridIdentityMetadataListByMachinesViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/hybridIdentityMetadata$", 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.HybridCompute/machines/{machineName}/hybridIdentityMetadata'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/hybridIdentityMetadata" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.HybridIdentityMetadataListByMachines_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Returns the list of HybridIdentityMetadata of the given machine. - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataListByMachinesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/hybridIdentityMetadata$", 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.HybridCompute/machines/{machineName}/hybridIdentityMetadata'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/hybridIdentityMetadata" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.HybridIdentityMetadataListByMachinesWithResult_Call (request, eventListener,sender); - } - } - - /// Returns the list of HybridIdentityMetadata of the given machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataListByMachinesWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/hybridIdentityMetadata" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.HybridIdentityMetadataListByMachinesWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataListByMachinesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 HybridIdentityMetadataListByMachines_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the hybrid machine. - /// 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 HybridIdentityMetadataListByMachines_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Parameters supplied to the Create or Update license profile operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license profile. - /// - /// Parameters supplied to the Create or Update license profile operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var licenseProfileName = _match.Groups["licenseProfileName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles/" - + licenseProfileName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license profile. - /// - /// Parameters supplied to the Create or Update license profile operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var licenseProfileName = _match.Groups["licenseProfileName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles/" - + licenseProfileName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Json string supplied to the LicenseProfilesCreateOrUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Json string supplied to the LicenseProfilesCreateOrUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Parameters supplied to the Create or Update license profile operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the hybrid machine. - /// Parameters supplied to the Create or Update license profile operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// The operation to delete a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesDelete(string subscriptionId, string resourceGroupName, string machineName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); - } - } - - /// The operation to delete a license profile. - /// - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var licenseProfileName = _match.Groups["licenseProfileName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles/" - + licenseProfileName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the hybrid machine. - /// 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 LicenseProfilesDelete_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - } - } - - /// Retrieves information about the view of a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesGet(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Retrieves information about the view of a license profile. - /// - /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var licenseProfileName = _match.Groups["licenseProfileName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles/" - + licenseProfileName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Retrieves information about the view of a license profile. - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var licenseProfileName = _match.Groups["licenseProfileName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles/" - + licenseProfileName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Retrieves information about the view of a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesGetWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the hybrid machine. - /// 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 LicenseProfilesGet_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - } - } - - /// The operation to get all license profiles of a non-Azure machine - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the machine. - /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesList(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesList_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all license profiles of a non-Azure machine - /// - /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesListViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles$", 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.HybridCompute/machines/{machineName}/licenseProfiles'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesList_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all license profiles of a non-Azure machine - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles$", 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.HybridCompute/machines/{machineName}/licenseProfiles'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesListWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to get all license profiles of a non-Azure machine - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the machine. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesListWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesListWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfilesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfilesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the machine. - /// 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 LicenseProfilesList_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Parameters supplied to the Update license profile operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesUpdate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license profile. - /// - /// Parameters supplied to the Update license profile operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var licenseProfileName = _match.Groups["licenseProfileName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles/" - + licenseProfileName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license profile. - /// - /// Parameters supplied to the Update license profile operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var licenseProfileName = _match.Groups["licenseProfileName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/licenseProfiles/" - + licenseProfileName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Json string supplied to the LicenseProfilesUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicenseProfilesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Json string supplied to the LicenseProfilesUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license profile. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Parameters supplied to the Update license profile operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicenseProfilesUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var licenseProfileName = @"default"; - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/licenseProfiles/" - + global::System.Uri.EscapeDataString(licenseProfileName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicenseProfilesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the hybrid machine. - /// Parameters supplied to the Update license profile operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task LicenseProfilesUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Parameters supplied to the Create license operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesCreateOrUpdate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license. - /// - /// Parameters supplied to the Create license operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var licenseName = _match.Groups["licenseName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/licenses/" - + licenseName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license. - /// - /// Parameters supplied to the Create license operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var licenseName = _match.Groups["licenseName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/licenses/" - + licenseName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Json string supplied to the LicensesCreateOrUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Json string supplied to the LicensesCreateOrUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Parameters supplied to the Create license operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the license. - /// Parameters supplied to the Create license operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task LicensesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(licenseName),licenseName); - await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// The operation to delete a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesDelete(string subscriptionId, string resourceGroupName, string licenseName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); - } - } - - /// The operation to delete a license. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var licenseName = _match.Groups["licenseName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/licenses/" - + licenseName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the license. - /// 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 LicensesDelete_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(licenseName),licenseName); - await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); - } - } - - /// Retrieves information about the view of a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// a delegate that is 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.ConnectedMachine.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 LicensesGet(string subscriptionId, string resourceGroupName, string licenseName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Retrieves information about the view of a license. - /// - /// a delegate that is 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.ConnectedMachine.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 LicensesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var licenseName = _match.Groups["licenseName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/licenses/" - + licenseName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Retrieves information about the view of a license. - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var licenseName = _match.Groups["licenseName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/licenses/" - + licenseName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Retrieves information about the view of a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesGetWithResult(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the license. - /// 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 LicensesGet_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(licenseName),licenseName); - await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// 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.ConnectedMachine.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 LicensesListByResourceGroup(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// - /// a delegate that is 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.ConnectedMachine.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 LicensesListByResourceGroupViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses$", 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.HybridCompute/licenses'"); - } - - // 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.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses$", 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.HybridCompute/licenses'"); - } - - // 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.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesListByResourceGroupWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesListByResourceGroupWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListByResourceGroup_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// 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.ConnectedMachine.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 LicensesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// - /// a delegate that is 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.ConnectedMachine.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 LicensesListBySubscriptionViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses'"); - } - - // 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.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses'"); - } - - // 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.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesListBySubscriptionWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to get all licenses of a non-Azure machine - /// The ID of the target subscription. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/licenses" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesListBySubscriptionWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListBySubscription_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Parameters supplied to the Update license operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesUpdate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license. - /// - /// Parameters supplied to the Update license operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var licenseName = _match.Groups["licenseName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/licenses/" - + licenseName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license. - /// - /// Parameters supplied to the Update license operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var licenseName = _match.Groups["licenseName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/licenses/" - + licenseName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Json string supplied to the LicensesUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Json string supplied to the LicensesUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Parameters supplied to the Update license operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesUpdateWithResult(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/licenses/" - + global::System.Uri.EscapeDataString(licenseName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. - /// The name of the license. - /// Parameters supplied to the Update license operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task LicensesUpdate_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(licenseName),licenseName); - await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// The operation to validate a license. - /// The ID of the target subscription. - /// Parameters supplied to the license validation operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesValidateLicense(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/validateLicense" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesValidateLicense_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to validate a license. - /// - /// Parameters supplied to the license validation operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesValidateLicenseViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute'"); - } - - // 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.HybridCompute/validateLicense" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesValidateLicense_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to validate a license. - /// - /// Parameters supplied to the license validation operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesValidateLicenseViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute'"); - } - - // 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.HybridCompute/validateLicense" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesValidateLicenseWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to validate a license. - /// The ID of the target subscription. - /// Json string supplied to the LicensesValidateLicense operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesValidateLicenseViaJsonString(string subscriptionId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/validateLicense" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LicensesValidateLicense_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to validate a license. - /// The ID of the target subscription. - /// Json string supplied to the LicensesValidateLicense operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesValidateLicenseViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/validateLicense" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesValidateLicenseWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to validate a license. - /// The ID of the target subscription. - /// Parameters supplied to the license validation operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task LicensesValidateLicenseWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/validateLicense" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.LicensesValidateLicenseWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesValidateLicenseWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); var operationLocation = _response.GetFirstHeader(@"Operation-Location"); @@ -9380,10 +1134,10 @@ public partial class ConnectedMachine continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + if (!string.IsNullOrWhiteSpace(_originalUri)) { // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -9402,7 +1156,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -9427,16 +1181,294 @@ public partial class ConnectedMachine } finally { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. + /// The name of the hybrid machine. + /// Parameters supplied to the Create or Update license profile operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LicenseProfilesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfile body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// The operation to delete a license profile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesDelete(string subscriptionId, string resourceGroupName, string machineName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicenseProfilesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); + } + } + + /// The operation to delete a license profile. + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is 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.ConnectedMachine.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 LicenseProfilesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + var licenseProfileName = _match.Groups["licenseProfileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/licenseProfiles/" + + licenseProfileName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicenseProfilesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is 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). @@ -9445,7 +1477,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LicensesValidateLicense_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicenseProfilesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9560,7 +1592,13 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: @@ -9582,44 +1620,46 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. - /// Parameters supplied to the license validation operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. /// 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 LicensesValidateLicense_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicenseProfilesDelete_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(machineName),machineName); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); } } - /// The operation to update the extension. + /// Retrieves information about the view of a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Parameters supplied to the Create Machine Extension operation. + /// The name of the hybrid machine. /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicenseProfilesGet(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9631,8 +1671,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9641,50 +1681,44 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.LicenseProfilesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update the extension. + /// Retrieves information about the view of a license profile. /// - /// Parameters supplied to the Create Machine Extension operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicenseProfilesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var machineName = _match.Groups["machineName"].Value; - var extensionName = _match.Groups["extensionName"].Value; + var licenseProfileName = _match.Groups["licenseProfileName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -9693,8 +1727,8 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName - + "/extensions/" - + extensionName + + "/licenseProfiles/" + + licenseProfileName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9703,48 +1737,42 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.LicenseProfilesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update the extension. + /// Retrieves information about the view of a license profile. /// - /// Parameters supplied to the Create Machine Extension operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicenseProfilesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var machineName = _match.Groups["machineName"].Value; - var extensionName = _match.Groups["extensionName"].Value; + var licenseProfileName = _match.Groups["licenseProfileName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -9753,108 +1781,8 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName - + "/extensions/" - + extensionName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.MachineExtensionsCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update the extension. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Json string supplied to the MachineExtensionsCreateOrUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MachineExtensionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update the extension. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Json string supplied to the MachineExtensionsCreateOrUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/licenseProfiles/" + + licenseProfileName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9863,35 +1791,29 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.LicenseProfilesGetWithResult_Call (request, eventListener,sender); } } - /// The operation to update the extension. + /// Retrieves information about the view of a license profile. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Parameters supplied to the Create Machine Extension operation. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicenseProfilesGetWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9903,8 +1825,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9913,30 +1835,24 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.LicenseProfilesGetWithResult_Call (request, eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicenseProfilesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9945,103 +1861,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -10050,7 +1871,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -10066,139 +1887,44 @@ public partial class ConnectedMachine var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); throw ex; } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -10207,7 +1933,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -10229,19 +1955,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Parameters supplied to the Create Machine Extension operation. + /// The name of the hybrid machine. /// 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 MachineExtensionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicenseProfilesGet_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10251,22 +1975,15 @@ public partial class ConnectedMachine await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(extensionName),extensionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); } } - /// The operation to delete the extension. + /// The operation to get all license profiles of a non-Azure machine /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be deleted. - /// The name of the machine extension. + /// The name of the machine. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -10274,9 +1991,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsDelete(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesList(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10288,8 +2005,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/licenseProfiles" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10298,19 +2014,18 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + await this.LicenseProfilesList_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to delete the extension. + /// The operation to get all license profiles of a non-Azure machine /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -10318,25 +2033,24 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesListViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var machineName = _match.Groups["machineName"].Value; - var extensionName = _match.Groups["extensionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -10345,8 +2059,7 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName - + "/extensions/" - + extensionName + + "/licenseProfiles" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10355,133 +2068,190 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + await this.LicenseProfilesList_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The operation to get all license profiles of a non-Azure machine + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineExtensionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { + var apiVersion = @"2024-07-10"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles'"); + } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/licenseProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + // 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.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicenseProfilesListWithResult_Call (request, eventListener,sender); + } + } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } + /// The operation to get all license profiles of a non-Azure machine + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesListWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } + // 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.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicenseProfilesListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfilesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -10490,13 +2260,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfilesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -10518,18 +2282,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be deleted. - /// The name of the machine extension. + /// The name of the machine. /// 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 MachineExtensionsDelete_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicenseProfilesList_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10542,26 +2305,27 @@ public partial class ConnectedMachine await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(extensionName),extensionName); } } - /// The operation to get the extension. + /// The operation to update a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine containing the extension. - /// The name of the machine extension. + /// The name of the hybrid machine. + /// Parameters supplied to the Update license profile operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsGet(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesUpdate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10573,8 +2337,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10583,44 +2347,50 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.LicenseProfilesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get the extension. + /// The operation to update a license profile. /// + /// Parameters supplied to the Update license profile operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var machineName = _match.Groups["machineName"].Value; - var extensionName = _match.Groups["extensionName"].Value; + var licenseProfileName = _match.Groups["licenseProfileName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -10629,8 +2399,8 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName - + "/extensions/" - + extensionName + + "/licenseProfiles/" + + licenseProfileName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10639,52 +2409,158 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.LicenseProfilesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get the extension. + /// The operation to update a license profile. /// + /// Parameters supplied to the Update license profile operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/licenseProfiles/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var machineName = _match.Groups["machineName"].Value; - var extensionName = _match.Groups["extensionName"].Value; + var licenseProfileName = _match.Groups["licenseProfileName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/licenseProfiles/" + + licenseProfileName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicenseProfilesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to update a license profile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Json string supplied to the LicenseProfilesUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicenseProfilesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update a license profile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Json string supplied to the LicenseProfilesUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/extensions/" - + extensionName + + global::System.Uri.EscapeDataString(machineName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10693,29 +2569,35 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsGetWithResult_Call (request, eventListener,sender); + return await this.LicenseProfilesUpdateWithResult_Call (request, eventListener,sender); } } - /// The operation to get the extension. + /// The operation to update a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine containing the extension. - /// The name of the machine extension. + /// The name of the hybrid machine. + /// Parameters supplied to the Update license profile operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsGetWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicenseProfilesUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var licenseProfileName = @"default"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10727,8 +2609,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/licenseProfiles/" + + global::System.Uri.EscapeDataString(licenseProfileName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10737,24 +2619,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsGetWithResult_Call (request, eventListener,sender); + return await this.LicenseProfilesUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicenseProfilesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10763,70 +2649,260 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicenseProfilesUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; + continue; } - default: + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; } } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -10835,7 +2911,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicenseProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -10857,18 +2933,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine containing the extension. - /// The name of the machine extension. + /// The name of the hybrid machine. + /// Parameters supplied to the Update license profile operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineExtensionsGet_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicenseProfilesUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseProfileUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10878,29 +2954,29 @@ public partial class ConnectedMachine await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(extensionName),extensionName); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// The operation to get all extensions of a non-Azure machine + /// The operation to update a license. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine containing the extension. - /// The expand expression to apply on the operation. + /// The name of the license. + /// Parameters supplied to the Create license operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsList(string subscriptionId, string resourceGroupName, string machineName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesCreateOrUpdate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10910,12 +2986,9 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions" + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10923,56 +2996,58 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsList_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get all extensions of a non-Azure machine + /// The operation to update a license. /// - /// The expand expression to apply on the operation. + /// Parameters supplied to the Create license operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsListViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; + var licenseName = _match.Groups["licenseName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/extensions" + + "/providers/Microsoft.HybridCompute/licenses/" + + licenseName + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10980,54 +3055,150 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsList_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get all extensions of a non-Azure machine + /// The operation to update a license. /// - /// The expand expression to apply on the operation. + /// Parameters supplied to the Create license operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsListViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; + var licenseName = _match.Groups["licenseName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/licenses/" + + licenseName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicensesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to update a license. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the license. + /// Json string supplied to the LicensesCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicensesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update a license. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the license. + /// Json string supplied to the LicensesCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/extensions" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11035,29 +3206,34 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsListWithResult_Call (request, eventListener,sender); + return await this.LicensesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// The operation to get all extensions of a non-Azure machine + /// The operation to update a license. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine containing the extension. - /// The expand expression to apply on the operation. + /// The name of the license. + /// Parameters supplied to the Create license operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsListWithResult(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11067,12 +3243,9 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions" + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11080,24 +3253,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsListWithResult_Call (request, eventListener,sender); + return await this.LicensesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11106,8 +3283,103 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -11116,7 +3388,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -11149,7 +3421,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -11159,7 +3431,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineExtensionsList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11168,8 +3440,103 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -11178,7 +3545,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -11200,18 +3567,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine containing the extension. - /// The expand expression to apply on the operation. + /// The name of the license. + /// Parameters supplied to the Create license operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineExtensionsList_Validate(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicensesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -11220,32 +3587,29 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(licenseName),licenseName); + await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// The operation to update the extension. + /// The operation to delete a license. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Parameters supplied to the Create Machine Extension operation. + /// The name of the license. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsUpdate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesDelete(string subscriptionId, string resourceGroupName, string licenseName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11255,10 +3619,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11267,60 +3629,52 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// The operation to update the extension. + /// The operation to delete a license. /// - /// Parameters supplied to the Create Machine Extension operation. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var extensionName = _match.Groups["extensionName"].Value; + var licenseName = _match.Groups["licenseName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/extensions/" - + extensionName + + "/providers/Microsoft.HybridCompute/licenses/" + + licenseName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11329,85 +3683,238 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// The operation to update the extension. - /// - /// Parameters supplied to the Create Machine Extension operation. + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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. + /// The name of the license. + /// 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 LicensesDelete_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(licenseName),licenseName); + await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); + } + } + + /// Retrieves information about the view of a license. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the license. + /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesGet(string subscriptionId, string resourceGroupName, string licenseName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var extensionName = _match.Groups["extensionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/extensions/" - + extensionName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - return await this.MachineExtensionsUpdateWithResult_Call (request, eventListener,sender); + await this.LicensesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update the extension. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Json string supplied to the MachineExtensionsUpdate operation + /// Retrieves information about the view of a license. + /// /// a delegate that is 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). @@ -11416,22 +3923,32 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var licenseName = _match.Groups["licenseName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + resourceGroupName + + "/providers/Microsoft.HybridCompute/licenses/" + + licenseName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11440,47 +3957,49 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineExtensionsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update the extension. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Json string supplied to the MachineExtensionsUpdate operation + /// Retrieves information about the view of a license. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/licenses/{licenseName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var licenseName = _match.Groups["licenseName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + resourceGroupName + + "/providers/Microsoft.HybridCompute/licenses/" + + licenseName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11489,35 +4008,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsUpdateWithResult_Call (request, eventListener,sender); + return await this.LicensesGetWithResult_Call (request, eventListener,sender); } } - /// The operation to update the extension. + /// Retrieves information about the view of a license. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Parameters supplied to the Create Machine Extension operation. + /// The name of the license. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineExtensionsUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesGetWithResult(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11527,10 +4039,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/extensions/" - + global::System.Uri.EscapeDataString(extensionName) + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11539,28 +4049,24 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineExtensionsUpdateWithResult_Call (request, eventListener,sender); + return await this.LicensesGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11569,103 +4075,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -11674,7 +4085,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -11707,7 +4118,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -11717,7 +4128,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineExtensionsUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11726,103 +4137,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -11831,7 +4147,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -11853,19 +4169,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the machine where the extension should be created or updated. - /// The name of the machine extension. - /// Parameters supplied to the Create Machine Extension operation. + /// The name of the license. /// 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 MachineExtensionsUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicensesGet_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -11874,34 +4188,25 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(extensionName),extensionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(licenseName),licenseName); + await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); } } - /// The operation to update a run command. + /// The operation to get all licenses of a non-Azure machine /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. - /// Parameters supplied to the Create Run Command. /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsCreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesListByResourceGroup(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11911,10 +4216,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands/" - + global::System.Uri.EscapeDataString(runCommandName) + + "/providers/Microsoft.HybridCompute/licenses" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11923,60 +4225,49 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineRunCommandsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update a run command. + /// The operation to get all licenses of a non-Azure machine /// - /// Parameters supplied to the Create Run Command. /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesListByResourceGroupViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/runCommands/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/licenses$", 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.HybridCompute/machines/{machineName}/runCommands/{runCommandName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var runCommandName = _match.Groups["runCommandName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/runCommands/" - + runCommandName + + "/providers/Microsoft.HybridCompute/licenses" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11985,158 +4276,47 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineRunCommandsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update a run command. + /// The operation to get all licenses of a non-Azure machine /// - /// Parameters supplied to the Create Run Command. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/runCommands/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/licenses$", 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.HybridCompute/machines/{machineName}/runCommands/{runCommandName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var runCommandName = _match.Groups["runCommandName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/runCommands/" - + runCommandName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.MachineRunCommandsCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a run command. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. - /// Json string supplied to the MachineRunCommandsCreateOrUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineRunCommandsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands/" - + global::System.Uri.EscapeDataString(runCommandName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MachineRunCommandsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a run command. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. - /// Json string supplied to the MachineRunCommandsCreateOrUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineRunCommandsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands/" - + global::System.Uri.EscapeDataString(runCommandName) + + "/providers/Microsoft.HybridCompute/licenses" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12145,35 +4325,27 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineRunCommandsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.LicensesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// The operation to update a run command. + /// The operation to get all licenses of a non-Azure machine /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. - /// Parameters supplied to the Create Run Command. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task LicensesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12183,10 +4355,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands/" - + global::System.Uri.EscapeDataString(runCommandName) + + "/providers/Microsoft.HybridCompute/licenses" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12195,30 +4364,26 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineRunCommandsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.LicensesListByResourceGroupWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineRunCommandsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12227,100 +4392,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -12329,7 +4402,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -12362,7 +4435,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -12372,7 +4445,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineRunCommandsCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesListByResourceGroup_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12381,100 +4454,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -12483,7 +4464,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -12505,19 +4486,16 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. - /// Parameters supplied to the Create Run Command. /// 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 MachineRunCommandsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicensesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -12526,22 +4504,12 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(runCommandName),runCommandName); - await eventListener.AssertRegEx(nameof(runCommandName), runCommandName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// The operation to delete a run command. + /// The operation to get all licenses of a non-Azure machine /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -12549,22 +4517,65 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsDelete(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/licenses" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicensesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to get all licenses of a non-Azure machine + /// + /// a delegate that is 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.ConnectedMachine.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 LicensesListBySubscriptionViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/licenses$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands/" - + global::System.Uri.EscapeDataString(runCommandName) + + subscriptionId + + "/providers/Microsoft.HybridCompute/licenses" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12573,76 +4584,162 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineRunCommandsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + await this.LicensesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to delete a run command. + /// The operation to get all licenses of a non-Azure machine /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/runCommands/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/licenses$", 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.HybridCompute/machines/{machineName}/runCommands/{runCommandName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var runCommandName = _match.Groups["runCommandName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/runCommands/" - + runCommandName + + "/providers/Microsoft.HybridCompute/licenses" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicensesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to get all licenses of a non-Azure machine + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/licenses" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MachineRunCommandsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + return await this.LicensesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -12650,7 +4747,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineRunCommandsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesListBySubscription_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12659,101 +4756,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -12762,13 +4766,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.LicensesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -12790,49 +4788,40 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get + /// 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. - /// The name of the hybrid machine. - /// The name of the run command. /// 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 MachineRunCommandsDelete_Validate(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicensesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(runCommandName),runCommandName); - await eventListener.AssertRegEx(nameof(runCommandName), runCommandName, @"[a-zA-Z0-9-_\.]+"); } } - /// The operation to get a run command. + /// The operation to update a license. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. + /// The name of the license. + /// Parameters supplied to the Update license operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsGet(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesUpdate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12842,10 +4831,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands/" - + global::System.Uri.EscapeDataString(runCommandName) + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12854,54 +4841,57 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineRunCommandsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get a run command. + /// The operation to update a license. /// + /// Parameters supplied to the Update license operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/runCommands/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/runCommands/{runCommandName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var runCommandName = _match.Groups["runCommandName"].Value; + var licenseName = _match.Groups["licenseName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/runCommands/" - + runCommandName + + "/providers/Microsoft.HybridCompute/licenses/" + + licenseName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12910,52 +4900,55 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineRunCommandsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get a run command. + /// The operation to update a license. /// + /// Parameters supplied to the Update license operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/runCommands/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/licenses/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/runCommands/{runCommandName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - var runCommandName = _match.Groups["runCommandName"].Value; + var licenseName = _match.Groups["licenseName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/runCommands/" - + runCommandName + + "/providers/Microsoft.HybridCompute/licenses/" + + licenseName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12964,29 +4957,81 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineRunCommandsGetWithResult_Call (request, eventListener,sender); + return await this.LicensesUpdateWithResult_Call (request, eventListener,sender); } } - /// The operation to get a run command. + /// The operation to update a license. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. + /// The name of the license. + /// Json string supplied to the LicensesUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicensesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update a license. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the license. + /// Json string supplied to the LicensesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineRunCommandsGetWithResult(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string licenseName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12996,10 +5041,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands/" - + global::System.Uri.EscapeDataString(runCommandName) + + "/providers/Microsoft.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13008,24 +5051,75 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicensesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to update a license. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the license. + /// Parameters supplied to the Update license operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LicensesUpdateWithResult(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/licenses/" + + global::System.Uri.EscapeDataString(licenseName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineRunCommandsGetWithResult_Call (request, eventListener,sender); + return await this.LicensesUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineRunCommandsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13034,8 +5128,103 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -13044,7 +5233,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -13077,7 +5266,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -13087,7 +5276,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineRunCommandsGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13096,8 +5285,103 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -13106,7 +5390,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -13128,18 +5412,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The name of the run command. + /// The name of the license. + /// Parameters supplied to the Update license operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineRunCommandsGet_Validate(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicensesUpdate_Validate(string subscriptionId, string resourceGroupName, string licenseName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicenseUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13148,29 +5432,28 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(runCommandName),runCommandName); - await eventListener.AssertRegEx(nameof(runCommandName), runCommandName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(licenseName),licenseName); + await eventListener.AssertRegEx(nameof(licenseName), licenseName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to validate a license. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// Parameters supplied to the license validation operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsList(string subscriptionId, string resourceGroupName, string machineName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesValidateLicense(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13178,14 +5461,8 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands" + + "/providers/Microsoft.HybridCompute/validateLicense" + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13193,56 +5470,53 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineRunCommandsList_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesValidateLicense_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to validate a license. /// - /// The expand expression to apply on the operation. + /// Parameters supplied to the license validation operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsListViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesValidateLicenseViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/runCommands$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute$", 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.HybridCompute/machines/{machineName}/runCommands'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/runCommands" + + "/providers/Microsoft.HybridCompute/validateLicense" + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13250,54 +5524,135 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachineRunCommandsList_Call (request, onOk,onDefault,eventListener,sender); + await this.LicensesValidateLicense_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to validate a license. /// - /// The expand expression to apply on the operation. + /// Parameters supplied to the license validation operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsListViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesValidateLicenseViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/runCommands$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute$", 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.HybridCompute/machines/{machineName}/runCommands'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/runCommands" + + "/providers/Microsoft.HybridCompute/validateLicense" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LicensesValidateLicenseWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to validate a license. + /// The ID of the target subscription. + /// Json string supplied to the LicensesValidateLicense operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesValidateLicenseViaJsonString(string subscriptionId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/validateLicense" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LicensesValidateLicense_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to validate a license. + /// The ID of the target subscription. + /// Json string supplied to the LicensesValidateLicense operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesValidateLicenseViaJsonStringWithResult(string subscriptionId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/validateLicense" + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13305,29 +5660,32 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineRunCommandsListWithResult_Call (request, eventListener,sender); + return await this.LicensesValidateLicenseWithResult_Call (request, eventListener,sender); } } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to validate a license. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// Parameters supplied to the license validation operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachineRunCommandsListWithResult(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LicensesValidateLicenseWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13335,14 +5693,8 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/runCommands" + + "/providers/Microsoft.HybridCompute/validateLicense" + "?" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13350,24 +5702,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachineRunCommandsListWithResult_Call (request, eventListener,sender); + return await this.LicensesValidateLicenseWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineRunCommandsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LicensesValidateLicenseWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13376,70 +5732,262 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 LicensesValidateLicense_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; + continue; } - default: + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; } } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineRunCommandsList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -13448,7 +5996,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.License.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -13470,47 +6018,44 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// Parameters supplied to the license validation operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachineRunCommandsList_Validate(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LicensesValidateLicense_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// The operation to assess patches on a hybrid machine identity in Azure. + /// The operation to update the extension. /// The ID of the target subscription. - /// The name of the resource group. - /// The name of the hybrid machine. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Parameters supplied to the Create Machine Extension operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesAssessPatches(string subscriptionId, string resourceGroupName, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13521,8 +6066,9 @@ public partial class ConnectedMachine + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(name) - + "/assessPatches" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13531,43 +6077,50 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesAssessPatches_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to assess patches on a hybrid machine identity in Azure. + /// The operation to update the extension. /// + /// Parameters supplied to the Create Machine Extension operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesAssessPatchesViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{name}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var name = _match.Groups["name"].Value; + var machineName = _match.Groups["machineName"].Value; + var extensionName = _match.Groups["extensionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13575,8 +6128,9 @@ public partial class ConnectedMachine + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" - + name - + "/assessPatches" + + machineName + + "/extensions/" + + extensionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13585,41 +6139,48 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesAssessPatches_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to assess patches on a hybrid machine identity in Azure. + /// The operation to update the extension. /// + /// Parameters supplied to the Create Machine Extension operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesAssessPatchesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{name}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var name = _match.Groups["name"].Value; + var machineName = _match.Groups["machineName"].Value; + var extensionName = _match.Groups["extensionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13627,8 +6188,109 @@ public partial class ConnectedMachine + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" - + name - + "/assessPatches" + + machineName + + "/extensions/" + + extensionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MachineExtensionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to update the extension. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Json string supplied to the MachineExtensionsCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachineExtensionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update the extension. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Json string supplied to the MachineExtensionsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachineExtensionsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13637,28 +6299,35 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesAssessPatchesWithResult_Call (request, eventListener,sender); + return await this.MachineExtensionsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// The operation to assess patches on a hybrid machine identity in Azure. + /// The operation to update the extension. /// The ID of the target subscription. - /// The name of the resource group. - /// The name of the hybrid machine. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Parameters supplied to the Create Machine Extension operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesAssessPatchesWithResult(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13669,8 +6338,9 @@ public partial class ConnectedMachine + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(name) - + "/assessPatches" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13679,24 +6349,30 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesAssessPatchesWithResult_Call (request, eventListener,sender); + return await this.MachineExtensionsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesAssessPatchesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13710,8 +6386,7 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + // declared final-state-via: default var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); var operationLocation = _response.GetFirstHeader(@"Operation-Location"); @@ -13789,16 +6464,19 @@ public partial class ConnectedMachine continue; } // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - // drop the old response - _response?.Dispose(); + // drop the old response + _response?.Dispose(); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -13808,7 +6486,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineAssessPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -13841,7 +6519,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -13851,7 +6529,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesAssessPatches_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13865,8 +6543,7 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + // declared final-state-via: default var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); var operationLocation = _response.GetFirstHeader(@"Operation-Location"); @@ -13943,189 +6620,21 @@ public partial class ConnectedMachine { continue; } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineAssessPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 of the hybrid machine. - /// 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 MachinesAssessPatches_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.AssertNotNull(nameof(name),name); - } - } - - /// The operation to delete a hybrid machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesDelete(string subscriptionId, string resourceGroupName, string machineName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MachinesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); - } - } - - /// The operation to delete a hybrid machine. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)$", 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.HybridCompute/machines/{machineName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MachinesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -14134,13 +6643,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -14162,17 +6665,19 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Parameters supplied to the Create Machine Extension operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesDelete_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachineExtensionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14185,17 +6690,19 @@ public partial class ConnectedMachine await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); + await eventListener.AssertNotNull(nameof(extensionName),extensionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Retrieves information about the model view or the instance view of a hybrid machine. - /// + /// The operation to delete the extension. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// The name of the machine where the extension should be deleted. + /// The name of the machine extension. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -14203,9 +6710,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesGet(string subscriptionId, string resourceGroupName, string machineName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsDelete(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14217,31 +6724,29 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Retrieves information about the model view or the instance view of a hybrid machine. - /// + /// The operation to delete the extension. /// - /// The expand expression to apply on the operation. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -14249,24 +6754,25 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{machineName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var machineName = _match.Groups["machineName"].Value; + var extensionName = _match.Groups["extensionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -14275,208 +6781,143 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName + + "/extensions/" + + extensionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Retrieves information about the model view or the instance view of a hybrid machine. - /// - /// - /// The expand expression to apply on the operation. + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesGetViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); 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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.MachinesGetWithResult_Call (request, eventListener,sender); - } - } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - /// - /// Retrieves information about the model view or the instance view of a hybrid machine. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesGetWithResult(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); 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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.MachinesGetWithResult_Call (request, eventListener,sender); - } - } + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; + continue; } - default: + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; } } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -14485,7 +6926,13 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: @@ -14507,18 +6954,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// The name of the machine where the extension should be deleted. + /// The name of the machine extension. /// 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 MachinesGet_Validate(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachineExtensionsDelete_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14531,27 +6978,26 @@ public partial class ConnectedMachine await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(extensionName),extensionName); } } - /// The operation to install patches on a hybrid machine identity in Azure. + /// The operation to get the extension. /// The ID of the target subscription. - /// The name of the resource group. - /// The name of the hybrid machine. - /// Input for InstallPatches as directly received by the API + /// The name of the resource group. The name is case insensitive. + /// The name of the machine containing the extension. + /// The name of the machine extension. /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesInstallPatches(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachineExtensionsGet(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14562,8 +7008,9 @@ public partial class ConnectedMachine + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(name) - + "/installPatches" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14572,49 +7019,44 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesInstallPatches_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to install patches on a hybrid machine identity in Azure. + /// The operation to get the extension. /// - /// Input for InstallPatches as directly received by the API /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesInstallPatchesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachineExtensionsGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{name}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var name = _match.Groups["name"].Value; + var machineName = _match.Groups["machineName"].Value; + var extensionName = _match.Groups["extensionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -14622,8 +7064,9 @@ public partial class ConnectedMachine + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" - + name - + "/installPatches" + + machineName + + "/extensions/" + + extensionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14632,152 +7075,52 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesInstallPatches_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to install patches on a hybrid machine identity in Azure. + /// The operation to get the extension. /// - /// Input for InstallPatches as directly received by the API /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesInstallPatchesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachineExtensionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{name}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var name = _match.Groups["name"].Value; + var machineName = _match.Groups["machineName"].Value; + var extensionName = _match.Groups["extensionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + name - + "/installPatches" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.MachinesInstallPatchesWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to install patches on a hybrid machine identity in Azure. - /// The ID of the target subscription. - /// The name of the resource group. - /// The name of the hybrid machine. - /// Json string supplied to the MachinesInstallPatches operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesInstallPatchesViaJsonString(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(name) - + "/installPatches" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MachinesInstallPatches_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to install patches on a hybrid machine identity in Azure. - /// The ID of the target subscription. - /// The name of the resource group. - /// The name of the hybrid machine. - /// Json string supplied to the MachinesInstallPatches operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesInstallPatchesViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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) + + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(name) - + "/installPatches" + + machineName + + "/extensions/" + + extensionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14786,34 +7129,29 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesInstallPatchesWithResult_Call (request, eventListener,sender); + return await this.MachineExtensionsGetWithResult_Call (request, eventListener,sender); } } - /// The operation to install patches on a hybrid machine identity in Azure. + /// The operation to get the extension. /// The ID of the target subscription. - /// The name of the resource group. - /// The name of the hybrid machine. - /// Input for InstallPatches as directly received by the API + /// The name of the resource group. The name is case insensitive. + /// The name of the machine containing the extension. + /// The name of the machine extension. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesInstallPatchesWithResult(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachineExtensionsGetWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14824,8 +7162,9 @@ public partial class ConnectedMachine + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(name) - + "/installPatches" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14834,28 +7173,24 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesInstallPatchesWithResult_Call (request, eventListener,sender); + return await this.MachineExtensionsGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesInstallPatchesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -14864,101 +7199,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -14967,7 +7209,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineInstallPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -15000,7 +7242,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -15010,7 +7252,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesInstallPatches_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15019,101 +7261,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -15122,7 +7271,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineInstallPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -15144,37 +7293,39 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. - /// The name of the resource group. - /// The name of the hybrid machine. - /// Input for InstallPatches as directly received by the API + /// The name of the resource group. The name is case insensitive. + /// The name of the machine containing the extension. + /// The name of the machine extension. /// 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 MachinesInstallPatches_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachineExtensionsGet_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.AssertNotNull(nameof(name),name); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + 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(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); + await eventListener.AssertNotNull(nameof(extensionName),extensionName); } } - /// - /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// + /// The operation to get all extensions of a non-Azure machine /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Expands referenced resources. + /// The name of the machine containing the extension. + /// The expand expression to apply on the operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15183,9 +7334,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesListByResourceGroup(string subscriptionId, string resourceGroupName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsList(string subscriptionId, string resourceGroupName, string machineName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15195,11 +7346,13 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines" + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -15211,16 +7364,13 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// + /// The operation to get all extensions of a non-Azure machine /// - /// Expands referenced resources. + /// The expand expression to apply on the operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15229,34 +7379,37 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesListByResourceGroupViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsListViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions$", 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.HybridCompute/machines'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines" + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/extensions" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -15268,50 +7421,50 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// + /// The operation to get all extensions of a non-Azure machine /// - /// Expands referenced resources. + /// The expand expression to apply on the operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsListViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions$", 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.HybridCompute/machines'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines" + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/extensions" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -15323,26 +7476,24 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.MachineExtensionsListWithResult_Call (request, eventListener,sender); } } - /// - /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// + /// The operation to get all extensions of a non-Azure machine /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Expands referenced resources. + /// The name of the machine containing the extension. + /// The expand expression to apply on the operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsListWithResult(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15352,11 +7503,13 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines" + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions" + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -15368,21 +7521,19 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.MachineExtensionsListWithResult_Call (request, eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15401,7 +7552,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -15434,7 +7585,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -15444,7 +7595,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesListByResourceGroup_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15463,7 +7614,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtensionsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -15484,35 +7635,215 @@ public partial class ConnectedMachine } } - /// - /// 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. - /// Expands referenced resources. + /// + /// 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. + /// The name of the machine containing the extension. + /// The expand expression to apply on the operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MachineExtensionsList_Validate(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// The operation to update the extension. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Parameters supplied to the Create Machine Extension operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachineExtensionsUpdate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachineExtensionsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update the extension. + /// + /// Parameters supplied to the Create Machine Extension operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachineExtensionsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + var extensionName = _match.Groups["extensionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/extensions/" + + extensionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachineExtensionsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update the extension. + /// + /// Parameters supplied to the Create Machine Extension operation. /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task MachineExtensionsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2024-07-10"; + // Constant Parameters 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(Expand),Expand); + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/extensions/(?[^/]+)$", 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.HybridCompute/machines/{machineName}/extensions/{extensionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + var extensionName = _match.Groups["extensionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/extensions/" + + extensionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MachineExtensionsUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// + /// The operation to update the extension. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Json string supplied to the MachineExtensionsUpdate operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15521,9 +7852,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15531,7 +7862,12 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/machines" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15540,98 +7876,97 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + await this.MachineExtensionsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// - /// - /// a delegate that is 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). + /// The operation to update the extension. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Json string supplied to the MachineExtensionsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesListBySubscriptionViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'"); - } - - // 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.HybridCompute/machines" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + return await this.MachineExtensionsUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// - /// + /// The operation to update the extension. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Parameters supplied to the Create Machine Extension operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachineExtensionsUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'"); - } - - // 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.HybridCompute/machines" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/extensions/" + + global::System.Uri.EscapeDataString(extensionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15640,75 +7975,133 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesListBySubscriptionWithResult_Call (request, eventListener,sender); + return await this.MachineExtensionsUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next - /// page of hybrid machines. - /// - /// The ID of the target subscription. + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters using( NoSynchronizationContext ) { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/machines" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - // 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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.MachinesListBySubscriptionWithResult_Call (request, eventListener,sender); - } - } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -15717,7 +8110,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -15750,7 +8143,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -15760,7 +8153,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesListBySubscription_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachineExtensionsUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15769,8 +8162,103 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -15779,7 +8267,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineExtension.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -15801,110 +8289,64 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get + /// 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. + /// The name of the machine where the extension should be created or updated. + /// The name of the machine extension. + /// Parameters supplied to the Create Machine Extension operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachineExtensionsUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, string extensionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); + await eventListener.AssertNotNull(nameof(extensionName),extensionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// The operation to update a hybrid machine. + /// The operation to assess patches on a hybrid machine identity in Azure. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Parameters supplied to the Update hybrid machine operation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task MachinesUpdate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// The operation to update a hybrid machine. - /// - /// Parameters supplied to the Update hybrid machine operation. + /// The name of the resource group. + /// The name of the hybrid machine. /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachinesAssessPatches(string subscriptionId, string resourceGroupName, string name, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", 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.HybridCompute/machines/{machineName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" - + machineName + + global::System.Uri.EscapeDataString(name) + + "/assessPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15913,47 +8355,43 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesAssessPatches_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update a hybrid machine. + /// The operation to assess patches on a hybrid machine identity in Azure. /// - /// Parameters supplied to the Update hybrid machine operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachinesAssessPatchesViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)$", 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.HybridCompute/machines/{machineName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; + var name = _match.Groups["name"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -15961,55 +8399,8 @@ public partial class ConnectedMachine + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.MachinesUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// The operation to update a hybrid machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Json string supplied to the MachinesUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) + + name + + "/assessPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16018,44 +8409,50 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesAssessPatches_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to update a hybrid machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Json string supplied to the MachinesUpdate operation + /// The operation to assess patches on a hybrid machine identity in Azure. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesAssessPatchesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)$", 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.HybridCompute/machines/{name}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var name = _match.Groups["name"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) + + name + + "/assessPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16064,34 +8461,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesUpdateWithResult_Call (request, eventListener,sender); + return await this.MachinesAssessPatchesWithResult_Call (request, eventListener,sender); } } - /// The operation to update a hybrid machine. + /// The operation to assess patches on a hybrid machine identity in Azure. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// Parameters supplied to the Update hybrid machine operation. + /// The name of the resource group. + /// The name of the hybrid machine. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MachinesUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachinesAssessPatchesWithResult(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16102,7 +8493,8 @@ public partial class ConnectedMachine + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) + + global::System.Uri.EscapeDataString(name) + + "/assessPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16111,28 +8503,24 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.MachinesUpdateWithResult_Call (request, eventListener,sender); + return await this.MachinesAssessPatchesWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesAssessPatchesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16141,8 +8529,101 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -16151,7 +8632,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineAssessPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -16184,7 +8665,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -16194,7 +8675,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MachinesUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesAssessPatches_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16203,8 +8684,101 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -16213,7 +8787,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineAssessPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -16235,192 +8809,33 @@ public partial class ConnectedMachine } /// - /// 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. - /// The name of the hybrid machine. - /// Parameters supplied to the Update hybrid machine operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task MachinesUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// update the NetworkConfiguration of the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Network Configuration details - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsCreateOrUpdate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NetworkConfigurationsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); - } - } - - /// update the NetworkConfiguration of the target resource. - /// - /// Network Configuration details - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.HybridCompute/networkConfigurations/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.HybridCompute/networkConfigurations/current'"); - } - - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.NetworkConfigurationsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); - } - } - - /// update the NetworkConfiguration of the target resource. - /// - /// Network Configuration details - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.HybridCompute/networkConfigurations/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.HybridCompute/networkConfigurations/current'"); - } - - // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NetworkConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); + /// 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 of the hybrid machine. + /// 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 MachinesAssessPatches_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.AssertNotNull(nameof(name),name); } } - /// update the NetworkConfiguration of the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Json string supplied to the NetworkConfigurationsCreateOrUpdate operation + /// The operation to delete a hybrid machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16428,17 +8843,20 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsCreateOrUpdateViaJsonString(string resourceUri, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesDelete(string subscriptionId, string resourceGroupName, string machineName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16447,176 +8865,73 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkConfigurationsCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + await this.MachinesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// update the NetworkConfiguration of the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Json string supplied to the NetworkConfigurationsCreateOrUpdate operation + /// The operation to delete a hybrid machine. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsCreateOrUpdateViaJsonStringWithResult(string resourceUri, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + // verify that Identity format is an exact match for uri - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NetworkConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)$", 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.HybridCompute/machines/{machineName}'"); + } - /// update the NetworkConfiguration of the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Network Configuration details - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsCreateOrUpdateWithResult(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - return await this.NetworkConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkConfigurationsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await this.MachinesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16624,7 +8939,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkConfigurationsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16643,13 +8958,13 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } - case global::System.Net.HttpStatusCode.Created: + case global::System.Net.HttpStatusCode.NoContent: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onNoContent(_response); break; } default: @@ -16671,27 +8986,39 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Network Configuration details + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. /// 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 NetworkConfigurationsCreateOrUpdate_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachinesDelete_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + 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(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); } } - /// Returns a NetworkConfiguration for the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// + /// Retrieves information about the model view or the instance view of a hybrid machine. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The expand expression to apply on the operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -16700,19 +9027,24 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsGet(string resourceUri, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesGet(string subscriptionId, string resourceGroupName, string machineName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -16724,12 +9056,15 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkConfigurationsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns a NetworkConfiguration for the target resource. + /// + /// Retrieves information about the model view or the instance view of a hybrid machine. + /// /// + /// The expand expression to apply on the operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -16738,29 +9073,36 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.HybridCompute/networkConfigurations/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.HybridCompute/networkConfigurations/current'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'"); } // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -16772,41 +9114,51 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkConfigurationsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns a NetworkConfiguration for the target resource. + /// + /// Retrieves information about the model view or the instance view of a hybrid machine. + /// /// + /// The expand expression to apply on the operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkConfigurationsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesGetViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.HybridCompute/networkConfigurations/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.HybridCompute/networkConfigurations/current'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}'"); } // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -16818,31 +9170,41 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkConfigurationsGetWithResult_Call (request, eventListener,sender); + return await this.MachinesGetWithResult_Call (request, eventListener,sender); } } - /// Returns a NetworkConfiguration for the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// + /// Retrieves information about the model view or the instance view of a hybrid machine. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The expand expression to apply on the operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkConfigurationsGetWithResult(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesGetWithResult(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -16854,19 +9216,19 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkConfigurationsGetWithResult_Call (request, eventListener,sender); + return await this.MachinesGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkConfigurationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16885,7 +9247,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -16918,7 +9280,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -16928,7 +9290,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkConfigurationsGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16947,7 +9309,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -16969,25 +9331,39 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The expand expression to apply on the operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkConfigurationsGet_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachinesGet_Validate(string subscriptionId, string resourceGroupName, string machineName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + 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(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); + await eventListener.AssertNotNull(nameof(Expand),Expand); } } - /// update the endpoint to the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Network Configuration details + /// The operation to install patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// Input for InstallPatches as directly received by the API /// a delegate that is 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). @@ -16997,17 +9373,21 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsUpdate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachinesInstallPatches(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(name) + + "/installPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17016,7 +9396,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -17025,13 +9405,13 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkConfigurationsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesInstallPatches_Call (request, onOk,onDefault,eventListener,sender); } } - /// update the endpoint to the target resource. + /// The operation to install patches on a hybrid machine identity in Azure. /// - /// Network Configuration details + /// Input for InstallPatches as directly received by the API /// a delegate that is 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). @@ -17041,27 +9421,33 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachinesInstallPatchesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.HybridCompute/networkConfigurations/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.HybridCompute/networkConfigurations/current'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'"); } // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var name = _match.Groups["name"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + name + + "/installPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17070,7 +9456,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -17079,41 +9465,47 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkConfigurationsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesInstallPatches_Call (request, onOk,onDefault,eventListener,sender); } } - /// update the endpoint to the target resource. + /// The operation to install patches on a hybrid machine identity in Azure. /// - /// Network Configuration details + /// Input for InstallPatches as directly received by the API /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachinesInstallPatchesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/(?[^/]+)/providers/Microsoft.HybridCompute/networkConfigurations/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/{resourceUri}/providers/Microsoft.HybridCompute/networkConfigurations/current'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'"); } // replace URI parameters with values from identity - var resourceUri = _match.Groups["resourceUri"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var name = _match.Groups["name"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + resourceUri - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + name + + "/installPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17122,7 +9514,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -17131,13 +9523,15 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkConfigurationsUpdateWithResult_Call (request, eventListener,sender); + return await this.MachinesInstallPatchesWithResult_Call (request, eventListener,sender); } } - /// update the endpoint to the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Json string supplied to the NetworkConfigurationsUpdate operation + /// The operation to install patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// Json string supplied to the MachinesInstallPatches operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -17146,17 +9540,21 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsUpdateViaJsonString(string resourceUri, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesInstallPatchesViaJsonString(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(name) + + "/installPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17165,7 +9563,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -17174,30 +9572,36 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkConfigurationsUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesInstallPatches_Call (request, onOk,onDefault,eventListener,sender); } } - /// update the endpoint to the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Json string supplied to the NetworkConfigurationsUpdate operation + /// The operation to install patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// Json string supplied to the MachinesInstallPatches operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkConfigurationsUpdateViaJsonStringWithResult(string resourceUri, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesInstallPatchesViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string name, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(name) + + "/installPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17206,7 +9610,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -17215,31 +9619,37 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkConfigurationsUpdateWithResult_Call (request, eventListener,sender); + return await this.MachinesInstallPatchesWithResult_Call (request, eventListener,sender); } } - /// update the endpoint to the target resource. - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Network Configuration details + /// The operation to install patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// Input for InstallPatches as directly received by the API /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkConfigurationsUpdateWithResult(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task MachinesInstallPatchesWithResult(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/" - + (resourceUri) - + "/providers/Microsoft.HybridCompute/networkConfigurations/current" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(name) + + "/installPatches" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17248,40 +9658,131 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.NetworkConfigurationsUpdateWithResult_Call (request, eventListener,sender); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MachinesInstallPatchesWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 MachinesInstallPatchesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkConfigurationsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -17290,7 +9791,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineInstallPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -17323,7 +9824,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -17333,7 +9834,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkConfigurationsUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesInstallPatches_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17342,8 +9843,101 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -17352,7 +9946,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineInstallPatchesResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -17374,29 +9968,37 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// Network Configuration details + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// Input for InstallPatches as directly received by the API /// 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 NetworkConfigurationsUpdate_Validate(string resourceUri, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachinesInstallPatches_Validate(string subscriptionId, string resourceGroupName, string name, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesParameters body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(resourceUri),resourceUri); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(name),name); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// The operation to get network information of hybrid machine + /// + /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. + /// Expands referenced resources. /// a delegate that is 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). @@ -17405,9 +10007,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkProfileGet(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListByResourceGroup(string subscriptionId, string resourceGroupName, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17417,11 +10019,11 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/networkProfile" + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -17433,12 +10035,16 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkProfileGet_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get network information of hybrid machine + /// + /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// + /// Expands referenced resources. /// a delegate that is 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). @@ -17447,35 +10053,34 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkProfileGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListByResourceGroupViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/networkProfile$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines$", 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.HybridCompute/machines/{machineName}/networkProfile'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/networkProfile" + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -17487,47 +10092,50 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkProfileGet_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// The operation to get network information of hybrid machine + /// + /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// + /// Expands referenced resources. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkProfileGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/networkProfile$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines$", 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.HybridCompute/machines/{machineName}/networkProfile'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/networkProfile" + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -17539,23 +10147,26 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkProfileGetWithResult_Call (request, eventListener,sender); + return await this.MachinesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// The operation to get network information of hybrid machine + /// + /// Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. + /// Expands referenced resources. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkProfileGetWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17565,11 +10176,11 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/networkProfile" + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -17581,19 +10192,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkProfileGetWithResult_Call (request, eventListener,sender); + return await this.MachinesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkProfileGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17612,7 +10225,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -17645,7 +10258,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -17655,7 +10268,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkProfileGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesListByResourceGroup_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17674,7 +10287,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -17696,17 +10309,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. + /// Expands referenced resources. /// 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 NetworkProfileGet_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachinesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Expand, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -17715,19 +10328,15 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); - await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); - await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); + await eventListener.AssertNotNull(nameof(Expand),Expand); } } - /// Gets the network security perimeter configuration for a private link scope. + /// + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter - /// resource. /// a delegate that is 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). @@ -17736,9 +10345,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17746,12 +10355,7 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/networkSecurityPerimeterConfigurations/" - + global::System.Uri.EscapeDataString(perimeterName) + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17765,11 +10369,14 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the network security perimeter configuration for a private link scope. + /// + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -17779,35 +10386,27 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListBySubscriptionViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/machines$", 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.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var perimeterName = _match.Groups["perimeterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/networkSecurityPerimeterConfigurations/" - + perimeterName + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17821,47 +10420,42 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets the network security perimeter configuration for a private link scope. + /// + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/machines$", 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.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var perimeterName = _match.Groups["perimeterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/networkSecurityPerimeterConfigurations/" - + perimeterName + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17875,25 +10469,24 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult_Call (request, eventListener,sender); + return await this.MachinesListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// Gets the network security perimeter configuration for a private link scope. + /// + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next + /// page of hybrid machines. + /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter - /// resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17901,12 +10494,7 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/networkSecurityPerimeterConfigurations/" - + global::System.Uri.EscapeDataString(perimeterName) + + "/providers/Microsoft.HybridCompute/machines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17920,21 +10508,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult_Call (request, eventListener,sender); + return await this.MachinesListBySubscriptionWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17953,7 +10541,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -17986,9 +10574,7 @@ public partial class ConnectedMachine } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -17998,7 +10584,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesListBySubscription_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18017,7 +10603,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -18039,49 +10625,40 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like - /// the actual call, but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter - /// resource. /// 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 NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachinesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(scopeName),scopeName); - await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(perimeterName),perimeterName); - await eventListener.AssertRegEx(nameof(perimeterName), perimeterName, @"^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[.]{1}.+$"); } } - /// Lists the network security perimeter configurations for a private link scope. + /// The operation to update a hybrid machine. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the hybrid machine. + /// Parameters supplied to the Update hybrid machine operation. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesUpdate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18091,9 +10668,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/networkSecurityPerimeterConfigurations" + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18102,17 +10678,140 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists the network security perimeter configurations for a private link scope. + /// The operation to update a hybrid machine. + /// + /// Parameters supplied to the Update hybrid machine operation. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachinesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/(?[^/]+)$", 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.HybridCompute/machines/{machineName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to update a hybrid machine. /// + /// Parameters supplied to the Update hybrid machine operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MachinesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/(?[^/]+)$", 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.HybridCompute/machines/{machineName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MachinesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to update a hybrid machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Json string supplied to the MachinesUpdate operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -18121,33 +10820,20 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations$", 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.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/networkSecurityPerimeterConfigurations" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18156,50 +10842,44 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.MachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists the network security perimeter configurations for a private link scope. - /// + /// The operation to update a hybrid machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Json string supplied to the MachinesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations$", 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.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/networkSecurityPerimeterConfigurations" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18208,28 +10888,34 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); + return await this.MachinesUpdateWithResult_Call (request, eventListener,sender); } } - /// Lists the network security perimeter configurations for a private link scope. + /// The operation to update a hybrid machine. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the hybrid machine. + /// Parameters supplied to the Update hybrid machine operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MachinesUpdateWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18239,9 +10925,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/networkSecurityPerimeterConfigurations" + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18250,26 +10935,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); + return await this.MachinesUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18288,7 +10975,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -18321,9 +11008,7 @@ public partial class ConnectedMachine } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -18333,7 +11018,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MachinesUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18352,7 +11037,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Machine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -18374,17 +11059,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like - /// the actual call, but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the hybrid machine. + /// Parameters supplied to the Update hybrid machine operation. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MachinesUpdate_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -18393,19 +11079,20 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(scopeName),scopeName); - await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Forces the network security perimeter configuration to refresh for a private link scope. - /// + /// The operation to get network information of hybrid machine /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter - /// resource. + /// The name of the hybrid machine. + /// a delegate that is 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. @@ -18413,9 +11100,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkProfileGet(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18425,11 +11112,9 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/networkSecurityPerimeterConfigurations/" - + global::System.Uri.EscapeDataString(perimeterName) - + "/reconcile" + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/networkProfile" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18438,85 +11123,172 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_Call (request, onDefault,eventListener,sender); + await this.NetworkProfileGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Forces the network security perimeter configuration to refresh for a private link scope. - /// + /// The operation to get network information of hybrid machine /// + /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task NetworkProfileGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/(?[^/]+)/networkProfile$", 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.HybridCompute/machines/{machineName}/networkProfile'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/networkProfile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NetworkProfileGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// The operation to get network information of hybrid machine + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkProfileGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/machines/(?[^/]+)/networkProfile$", 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.HybridCompute/machines/{machineName}/networkProfile'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/networkProfile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.NetworkProfileGetWithResult_Call (request, eventListener,sender); + } + } + + /// The operation to get network information of hybrid machine + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkProfileGetWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var perimeterName = _match.Groups["perimeterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/networkSecurityPerimeterConfigurations/" - + perimeterName - + "/reconcile" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/networkProfile" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_Call (request, onDefault,eventListener,sender); + return await this.NetworkProfileGetWithResult_Call (request, eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NetworkProfileGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18524,110 +11296,82 @@ public partial class ConnectedMachine try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkProfileGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkProfile.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -18647,19 +11391,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this - /// like the actual call, but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter - /// resource. + /// The name of the hybrid machine. /// 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 NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NetworkProfileGet_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -18668,14 +11410,19 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(scopeName),scopeName); - await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(perimeterName),perimeterName); - await eventListener.AssertRegEx(nameof(perimeterName), perimeterName, @"^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[.]{1}.+$"); + await eventListener.AssertNotNull(nameof(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertMaximumLength(nameof(machineName),machineName,54); + await eventListener.AssertRegEx(nameof(machineName), machineName, @"^[a-zA-Z0-9-_\.]{1,54}$"); } } - /// Gets a list of hybrid compute operations. + /// Gets the network security perimeter configuration for a private link scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter + /// resource. /// a delegate that is 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). @@ -18684,15 +11431,22 @@ public partial class ConnectedMachine /// /// 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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "/networkSecurityPerimeterConfigurations/" + + global::System.Uri.EscapeDataString(perimeterName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18706,11 +11460,11 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a list of hybrid compute operations. + /// Gets the network security perimeter configuration for a private link scope. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -18720,24 +11474,35 @@ public partial class ConnectedMachine /// /// 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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + var perimeterName = _match.Groups["perimeterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/operations" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/networkSecurityPerimeterConfigurations/" + + perimeterName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18751,36 +11516,47 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a list of hybrid compute operations. + /// Gets the network security perimeter configuration for a private link scope. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + var perimeterName = _match.Groups["perimeterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/operations" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/networkSecurityPerimeterConfigurations/" + + perimeterName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18794,26 +11570,38 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.OperationsListWithResult_Call (request, eventListener,sender); + return await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } - /// Gets a list of hybrid compute operations. + /// Gets the network security perimeter configuration for a private link scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter + /// resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.HybridCompute/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "/networkSecurityPerimeterConfigurations/" + + global::System.Uri.EscapeDataString(perimeterName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18827,19 +11615,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.OperationsListWithResult_Call (request, eventListener,sender); + return await this.NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18858,7 +11648,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -18891,7 +11681,9 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -18901,7 +11693,7 @@ public partial class ConnectedMachine /// /// 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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18920,7 +11712,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -18942,39 +11734,49 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like + /// the actual call, but you will get validation events back. /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter + /// resource. /// 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.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsGetByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(scopeName),scopeName); + await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(perimeterName),perimeterName); + await eventListener.AssertRegEx(nameof(perimeterName), perimeterName, @"^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[.]{1}.+$"); } } - /// Approve or reject a private endpoint connection with a given name. + /// Lists the network security perimeter configurations for a private link scope. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. - /// A private endpoint connection /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18986,8 +11788,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/networkSecurityPerimeterConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18996,50 +11797,43 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Approve or reject a private endpoint connection with a given name. + /// Lists the network security perimeter configurations for a private link scope. /// - /// A private endpoint connection /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var scopeName = _match.Groups["scopeName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -19048,8 +11842,7 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + + "/networkSecurityPerimeterConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19058,158 +11851,50 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Approve or reject a private endpoint connection with a given name. + /// Lists the network security perimeter configurations for a private link scope. /// - /// A private endpoint connection /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/privateEndpointConnections/" - + privateEndpointConnectionName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. - /// Json string supplied to the PrivateEndpointConnectionsCreateOrUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Approve or reject a private endpoint connection with a given name. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. - /// Json string supplied to the PrivateEndpointConnectionsCreateOrUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + scopeName + + "/networkSecurityPerimeterConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19218,35 +11903,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } - /// Approve or reject a private endpoint connection with a given name. + /// Lists the network security perimeter configurations for a private link scope. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. - /// A private endpoint connection /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19258,8 +11936,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/networkSecurityPerimeterConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19268,30 +11945,26 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -19300,103 +11973,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - break; - } - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -19405,7 +11983,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -19439,7 +12017,7 @@ public partial class ConnectedMachine } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -19450,112 +12028,17 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -19564,7 +12047,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -19586,19 +12069,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like + /// the actual call, but you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. - /// A private endpoint connection /// 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 PrivateEndpointConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsListByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -19609,19 +12090,18 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes a private endpoint connection with a given name. + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter + /// resource. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -19629,9 +12109,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19643,8 +12123,9 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "/networkSecurityPerimeterConfigurations/" + + global::System.Uri.EscapeDataString(perimeterName) + + "/reconcile" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19653,19 +12134,20 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + await this.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes a private endpoint connection with a given name. + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -19673,56 +12155,321 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + var perimeterName = _match.Groups["perimeterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/networkSecurityPerimeterConfigurations/" + + perimeterName + + "/reconcile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/networkSecurityPerimeterConfigurations/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + var perimeterName = _match.Groups["perimeterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/networkSecurityPerimeterConfigurations/" + + perimeterName + + "/reconcile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter + /// resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "/networkSecurityPerimeterConfigurations/" + + global::System.Uri.EscapeDataString(perimeterName) + + "/reconcile" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/privateEndpointConnections/" - + privateEndpointConnectionName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - // 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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationReconcileResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -19730,7 +12477,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -19845,13 +12592,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkSecurityPerimeterConfigurationReconcileResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -19873,18 +12614,19 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this + /// like the actual call, but you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter + /// resource. /// 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 PrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -19895,15 +12637,12 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(perimeterName),perimeterName); + await eventListener.AssertRegEx(nameof(perimeterName), perimeterName, @"^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[.]{1}.+$"); } } - /// Gets a private endpoint connection. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. + /// Gets a list of hybrid compute 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). @@ -19912,22 +12651,15 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "/providers/Microsoft.HybridCompute/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19941,11 +12673,11 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a private endpoint connection. + /// Gets a list of hybrid compute 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 @@ -19955,35 +12687,24 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/operations$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/operations'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + "/providers/Microsoft.HybridCompute/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19997,47 +12718,36 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a private endpoint connection. + /// Gets a list of hybrid compute operations. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.HybridCompute/operations$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.HybridCompute/operations'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/privateEndpointConnections/" - + privateEndpointConnectionName + "/providers/Microsoft.HybridCompute/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20051,37 +12761,26 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// Gets a private endpoint connection. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. + /// Gets a list of hybrid compute operations. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsGetWithResult(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections/" - + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "/providers/Microsoft.HybridCompute/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20095,21 +12794,19 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20128,7 +12825,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -20161,7 +12858,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -20171,7 +12868,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20190,7 +12887,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -20212,47 +12909,39 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private endpoint connection. /// 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 PrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(scopeName),scopeName); - await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } } - /// Gets all private endpoint connections on a private link scope. + /// Approve or reject a private endpoint connection with a given name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. + /// A private endpoint connection /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20264,7 +12953,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections" + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20273,43 +12963,50 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets all private endpoint connections on a private link scope. + /// Approve or reject a private endpoint connection with a given name. /// + /// A private endpoint connection /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var scopeName = _match.Groups["scopeName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20318,7 +13015,8 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName - + "/privateEndpointConnections" + + "/privateEndpointConnections/" + + privateEndpointConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20327,41 +13025,48 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateEndpointConnectionsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets all private endpoint connections on a private link scope. + /// Approve or reject a private endpoint connection with a given name. /// + /// A private endpoint connection /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var scopeName = _match.Groups["scopeName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20370,7 +13075,8 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName - + "/privateEndpointConnections" + + "/privateEndpointConnections/" + + privateEndpointConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20379,28 +13085,85 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateEndpointConnectionsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); + return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Gets all private endpoint connections on a private link scope. + /// Approve or reject a private endpoint connection with a given name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. + /// Json string supplied to the PrivateEndpointConnectionsCreateOrUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Approve or reject a private endpoint connection with a given name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. + /// Json string supplied to the PrivateEndpointConnectionsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsListByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20412,45 +13175,195 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateEndpointConnections" + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Approve or reject a private endpoint connection with a given name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. + /// A private endpoint connection + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateEndpointConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - // 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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.PrivateEndpointConnectionsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); - } - } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateEndpointConnectionsListByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -20459,7 +13372,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -20493,7 +13406,7 @@ public partial class ConnectedMachine } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -20504,7 +13417,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdate_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20513,8 +13426,103 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -20523,7 +13531,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -20545,17 +13553,19 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. + /// A private endpoint connection /// 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 PrivateEndpointConnectionsListByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -20566,17 +13576,19 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// + /// Deletes a private endpoint connection with a given name. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private link resource. + /// The name of the private endpoint connection. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -20584,9 +13596,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkResourcesGet(string subscriptionId, string resourceGroupName, string scopeName, string groupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20598,66 +13610,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateLinkResources/" - + global::System.Uri.EscapeDataString(groupName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// - /// - /// a delegate that is 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.ConnectedMachine.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 PrivateLinkResourcesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - var groupName = _match.Groups["groupName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "/privateLinkResources/" - + groupName + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20666,44 +13620,45 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// + /// Deletes a private endpoint connection with a given name. /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkResourcesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var scopeName = _match.Groups["scopeName"].Value; - var groupName = _match.Groups["groupName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20712,134 +13667,29 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName - + "/privateLinkResources/" - + groupName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.PrivateLinkResourcesGetWithResult_Call (request, eventListener,sender); - } - } - - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private link resource. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesGetWithResult(string subscriptionId, string resourceGroupName, string scopeName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "/privateLinkResources/" - + global::System.Uri.EscapeDataString(groupName) + + "/privateEndpointConnections/" + + privateEndpointConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - return await this.PrivateLinkResourcesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await this.PrivateEndpointConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -20847,7 +13697,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkResourcesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20856,8 +13706,104 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -20866,7 +13812,13 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: @@ -20888,18 +13840,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// The name of the private link resource. + /// The name of the private endpoint connection. /// 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 PrivateLinkResourcesGet_Validate(string subscriptionId, string resourceGroupName, string scopeName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -20910,16 +13862,15 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(groupName),groupName); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); } } - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// + /// Gets a private endpoint connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. /// a delegate that is 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). @@ -20928,9 +13879,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20942,7 +13893,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateLinkResources" + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20956,13 +13908,11 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkResourcesListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// + /// Gets a private endpoint connection. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -20972,24 +13922,25 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var scopeName = _match.Groups["scopeName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20998,7 +13949,8 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName - + "/privateLinkResources" + + "/privateEndpointConnections/" + + privateEndpointConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21012,38 +13964,37 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkResourcesListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// + /// Gets a private endpoint connection. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesListByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections/{privateEndpointConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var scopeName = _match.Groups["scopeName"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -21052,7 +14003,8 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName - + "/privateLinkResources" + + "/privateEndpointConnections/" + + privateEndpointConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21066,25 +14018,24 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkResourcesListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); + return await this.PrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); } } - /// - /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. - /// + /// Gets a private endpoint connection. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesListByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetWithResult(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21096,7 +14047,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) - + "/privateLinkResources" + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21110,21 +14062,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkResourcesListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); + return await this.PrivateEndpointConnectionsGetWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesListByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21143,7 +14095,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -21176,9 +14128,7 @@ public partial class ConnectedMachine } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -21188,7 +14138,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21207,7 +14157,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -21229,17 +14179,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private endpoint connection. /// 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 PrivateLinkResourcesListByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string scopeName, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -21250,30 +14201,25 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); } } - /// - /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor - /// AppId in the Put operation. - /// + /// Gets all private endpoint connections on a private link scope. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21285,6 +14231,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21293,47 +14240,37 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor - /// AppId in the Put operation. - /// + /// Gets all private endpoint connections on a private link scope. /// - /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'"); } // replace URI parameters with values from identity @@ -21348,6 +14285,7 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21356,44 +14294,35 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + await this.PrivateEndpointConnectionsListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor - /// AppId in the Put operation. - /// + /// Gets all private endpoint connections on a private link scope. /// - /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateEndpointConnections$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateEndpointConnections'"); } // replace URI parameters with values from identity @@ -21408,6 +14337,7 @@ public partial class ConnectedMachine + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21416,138 +14346,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.PrivateLinkScopesCreateOrUpdateWithResult_Call (request, eventListener,sender); - } - } - - /// - /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor - /// AppId in the Put operation. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// Json string supplied to the PrivateLinkScopesCreateOrUpdate operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateLinkScopesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); - } - } - - /// - /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor - /// AppId in the Put operation. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// Json string supplied to the PrivateLinkScopesCreateOrUpdate operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.PrivateEndpointConnectionsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } - /// - /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor - /// AppId in the Put operation. - /// + /// Gets all private endpoint connections on a private link scope. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21559,6 +14379,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) + + "/privateEndpointConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21567,30 +14388,26 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesCreateOrUpdateWithResult_Call (request, eventListener,sender); + return await this.PrivateEndpointConnectionsListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21609,13 +14426,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -21648,10 +14459,11 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -21659,7 +14471,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21678,13 +14490,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -21706,18 +14512,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. /// 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 PrivateLinkScopesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -21728,17 +14533,17 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Deletes a Azure Arc PrivateLinkScope. + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private link resource. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -21746,9 +14551,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesDelete(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesGet(string subscriptionId, string resourceGroupName, string scopeName, string groupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21760,6 +14565,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(groupName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21768,19 +14575,20 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Deletes a Azure Arc PrivateLinkScope. + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -21788,53 +14596,217 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + var groupName = _match.Groups["groupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/privateLinkResources/" + + groupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources/{groupName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + var groupName = _match.Groups["groupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/privateLinkResources/" + + groupName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkResourcesGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private link resource. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesGetWithResult(string subscriptionId, string resourceGroupName, string scopeName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "/privateLinkResources/" + + global::System.Uri.EscapeDataString(groupName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkResourcesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkResourcesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateLinkScopesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -21842,7 +14814,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21851,104 +14823,8 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - var operationLocation = _response.GetFirstHeader(@"Operation-Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - // delay before making the next polling request - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { - operationLocation = _response.GetFirstHeader(@"Operation-Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -21957,13 +14833,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -21985,17 +14855,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get + /// 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. /// The name of the Azure Arc PrivateLinkScope resource. + /// The name of the private link resource. /// 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 PrivateLinkScopesDelete_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesGet_Validate(string subscriptionId, string resourceGroupName, string scopeName, string groupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -22006,10 +14877,13 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(groupName),groupName); } } - /// Returns a Azure Arc PrivateLinkScope. + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. @@ -22021,9 +14895,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesGet(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -22035,6 +14909,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + global::System.Uri.EscapeDataString(scopeName) + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22048,98 +14923,13 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesGet_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Returns a Azure Arc PrivateLinkScope's validation details. - /// The ID of the target subscription. - /// The location of the target resource. - /// The id (Guid) of the Azure Arc PrivateLinkScope resource. - /// a delegate that is 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.ConnectedMachine.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 PrivateLinkScopesGetValidationDetails(string subscriptionId, string location, string privateLinkScopeId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/locations/" - + global::System.Uri.EscapeDataString(location) - + "/privateLinkScopes/" - + global::System.Uri.EscapeDataString(privateLinkScopeId) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateLinkScopesGetValidationDetails_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the target machine to get the private link scope validation details for. - /// a delegate that is 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.ConnectedMachine.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 PrivateLinkScopesGetValidationDetailsForMachine(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/privateLinkScopes/current" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateLinkScopesGetValidationDetailsForMachine_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkResourcesListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -22149,33 +14939,33 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachineViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScopeViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/privateLinkScopes/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources$", 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.HybridCompute/machines/{machineName}/privateLinkScopes/current'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; + var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/privateLinkScopes/current" + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22189,45 +14979,47 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesGetValidationDetailsForMachine_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkResourcesListByPrivateLinkScope_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesGetValidationDetailsForMachineViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScopeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/machines/(?[^/]+)/privateLinkScopes/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)/privateLinkResources$", 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.HybridCompute/machines/{machineName}/privateLinkScopes/current'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/privateLinkResources'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var machineName = _match.Groups["machineName"].Value; + var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/machines/" - + machineName - + "/privateLinkScopes/current" + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22241,23 +15033,25 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesGetValidationDetailsForMachineWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkResourcesListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } - /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. + /// + /// Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the target machine to get the private link scope validation details for. + /// The name of the Azure Arc PrivateLinkScope resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesGetValidationDetailsForMachineWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScopeWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -22267,9 +15061,9 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/machines/" - + global::System.Uri.EscapeDataString(machineName) - + "/privateLinkScopes/current" + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "/privateLinkResources" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22283,21 +15077,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesGetValidationDetailsForMachineWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkResourcesListByPrivateLinkScopeWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesGetValidationDetailsForMachineWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScopeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22316,7 +15110,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -22350,7 +15144,7 @@ public partial class ConnectedMachine } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -22361,7 +15155,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachine_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScope_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22380,7 +15174,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -22402,17 +15196,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the target machine to get the private link scope validation details for. + /// The name of the Azure Arc PrivateLinkScope resource. /// 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 PrivateLinkScopesGetValidationDetailsForMachine_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByPrivateLinkScope_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -22421,14 +15215,197 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(machineName),machineName); - await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); + await eventListener.AssertNotNull(nameof(scopeName),scopeName); + await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); + } + } + + /// + /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor + /// AppId in the Put operation. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkScopesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor + /// AppId in the Put operation. + /// + /// + /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkScopesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor + /// AppId in the Put operation. + /// + /// + /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2024-07-10"; + // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateLinkScopesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Returns a Azure Arc PrivateLinkScope's validation details. - /// + /// + /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor + /// AppId in the Put operation. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// Json string supplied to the PrivateLinkScopesCreateOrUpdate operation /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -22436,32 +15413,20 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/locations/(?[^/]+)/privateLinkScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var privateLinkScopeId = _match.Groups["privateLinkScopeId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.HybridCompute/locations/" - + location - + "/privateLinkScopes/" - + privateLinkScopeId + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22470,49 +15435,47 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesGetValidationDetails_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Returns a Azure Arc PrivateLinkScope's validation details. - /// + /// + /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor + /// AppId in the Put operation. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// Json string supplied to the PrivateLinkScopesCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesGetValidationDetailsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/locations/(?[^/]+)/privateLinkScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; - var privateLinkScopeId = _match.Groups["privateLinkScopeId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.HybridCompute/locations/" - + location - + "/privateLinkScopes/" - + privateLinkScopeId + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22521,28 +15484,37 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesGetValidationDetailsWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Returns a Azure Arc PrivateLinkScope's validation details. + /// + /// update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor + /// AppId in the Put operation. + /// /// The ID of the target subscription. - /// The location of the target resource. - /// The id (Guid) of the Azure Arc PrivateLinkScope resource. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsWithResult(string subscriptionId, string location, string privateLinkScopeId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -22550,10 +15522,10 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/locations/" - + global::System.Uri.EscapeDataString(location) - + "/privateLinkScopes/" - + global::System.Uri.EscapeDataString(privateLinkScopeId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22562,26 +15534,30 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesGetValidationDetailsWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesGetValidationDetailsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22600,7 +15576,13 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -22633,11 +15615,10 @@ public partial class ConnectedMachine } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -22645,7 +15626,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetails_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22664,7 +15645,13 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -22686,31 +15673,39 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. - /// The location of the target resource. - /// The id (Guid) of the Azure Arc PrivateLinkScope resource. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// Properties that need to be specified to create or update a Azure Arc for Servers and Clusters PrivateLinkScope. /// 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 PrivateLinkScopesGetValidationDetails_Validate(string subscriptionId, string location, string privateLinkScopeId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertMinimumLength(nameof(location),location,1); - await eventListener.AssertNotNull(nameof(privateLinkScopeId),privateLinkScopeId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(scopeName),scopeName); + await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Returns a Azure Arc PrivateLinkScope. - /// + /// Deletes a Azure Arc PrivateLinkScope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -22718,32 +15713,20 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesDelete(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22752,26 +15735,29 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesGet_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Returns a Azure Arc PrivateLinkScope. + /// Deletes a Azure Arc PrivateLinkScope. /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -22799,123 +15785,23 @@ public partial class ConnectedMachine + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.PrivateLinkScopesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Returns a Azure Arc PrivateLinkScope. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesGetWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - return await this.PrivateLinkScopesGetWithResult_Call (request, eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - // Error Response : default - var code = (await _result)?.Code; - var message = (await _result)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(_response, await _result); - throw ex; - } - else - { - throw new global::System.Exception($"[{code}] : {message}"); - } - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await this.PrivateLinkScopesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -22923,7 +15809,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22932,8 +15818,104 @@ public partial class ConnectedMachine { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; @@ -22942,7 +15924,13 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: @@ -22964,8 +15952,8 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -22974,7 +15962,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesGet_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesDelete_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -22988,8 +15976,10 @@ public partial class ConnectedMachine } } - /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + /// Returns a Azure Arc PrivateLinkScope. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. /// a delegate that is 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). @@ -22998,9 +15988,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGet(string subscriptionId, string resourceGroupName, string scopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23008,7 +15998,10 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23022,13 +16015,57 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesList_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. + /// Returns a Azure Arc PrivateLinkScope's validation details. + /// The ID of the target subscription. + /// The location of the target resource. + /// The id (Guid) of the Azure Arc PrivateLinkScope resource. + /// a delegate that is 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.ConnectedMachine.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 PrivateLinkScopesGetValidationDetails(string subscriptionId, string location, string privateLinkScopeId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/locations/" + + global::System.Uri.EscapeDataString(location) + + "/privateLinkScopes/" + + global::System.Uri.EscapeDataString(privateLinkScopeId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkScopesGetValidationDetails_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the target machine to get the private link scope validation details for. /// a delegate that is 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). @@ -23037,9 +16074,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroup(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachine(string subscriptionId, string resourceGroupName, string machineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23049,7 +16086,9 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/privateLinkScopes/current" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23063,11 +16102,11 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesGetValidationDetailsForMachine_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. + /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -23077,30 +16116,33 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroupViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachineViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/privateLinkScopes/current$", 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.HybridCompute/privateLinkScopes'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/privateLinkScopes/current'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/privateLinkScopes/current" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23114,42 +16156,45 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesGetValidationDetailsForMachine_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. + /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachineViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/machines/(?[^/]+)/privateLinkScopes/current$", 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.HybridCompute/privateLinkScopes'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/privateLinkScopes/current'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var machineName = _match.Groups["machineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/providers/Microsoft.HybridCompute/machines/" + + machineName + + "/privateLinkScopes/current" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23163,22 +16208,23 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesGetValidationDetailsForMachineWithResult_Call (request, eventListener,sender); } } - /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. + /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the target machine to get the private link scope validation details for. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachineWithResult(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23188,7 +16234,9 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/providers/Microsoft.HybridCompute/machines/" + + global::System.Uri.EscapeDataString(machineName) + + "/privateLinkScopes/current" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23202,21 +16250,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesListByResourceGroupWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesGetValidationDetailsForMachineWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachineWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -23235,7 +16283,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -23269,7 +16317,7 @@ public partial class ConnectedMachine } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). @@ -23280,7 +16328,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroup_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachine_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -23299,7 +16347,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -23321,16 +16369,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. + /// The name of the target machine to get the private link scope validation details for. /// 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 PrivateLinkScopesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsForMachine_Validate(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -23339,10 +16388,12 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(machineName),machineName); + await eventListener.AssertMinimumLength(nameof(machineName),machineName,1); } } - /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + /// Returns a Azure Arc PrivateLinkScope's validation details. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -23352,27 +16403,32 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesListViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/locations/(?[^/]+)/privateLinkScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var privateLinkScopeId = _match.Groups["privateLinkScopeId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/providers/Microsoft.HybridCompute/locations/" + + location + + "/privateLinkScopes/" + + privateLinkScopeId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23386,39 +16442,44 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesList_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesGetValidationDetails_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + /// Returns a Azure Arc PrivateLinkScope's validation details. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/locations/(?[^/]+)/privateLinkScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/privateLinkScopes/{privateLinkScopeId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + var privateLinkScopeId = _match.Groups["privateLinkScopeId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/providers/Microsoft.HybridCompute/locations/" + + location + + "/privateLinkScopes/" + + privateLinkScopeId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23432,21 +16493,23 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesListWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesGetValidationDetailsWithResult_Call (request, eventListener,sender); } } - /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + /// Returns a Azure Arc PrivateLinkScope's validation details. /// The ID of the target subscription. + /// The location of the target resource. + /// The id (Guid) of the Azure Arc PrivateLinkScope resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsWithResult(string subscriptionId, string location, string privateLinkScopeId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23454,7 +16517,10 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "/providers/Microsoft.HybridCompute/locations/" + + global::System.Uri.EscapeDataString(location) + + "/privateLinkScopes/" + + global::System.Uri.EscapeDataString(privateLinkScopeId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23468,19 +16534,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesListWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesGetValidationDetailsWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetailsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -23499,7 +16567,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -23532,7 +16600,9 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -23542,7 +16612,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetails_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -23561,7 +16631,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.PrivateLinkScopeValidationDetails.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -23583,150 +16653,41 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// /// The ID of the target subscription. + /// The location of the target resource. + /// The id (Guid) of the Azure Arc PrivateLinkScope resource. /// 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 PrivateLinkScopesList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetValidationDetails_Validate(string subscriptionId, string location, string privateLinkScopeId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertMinimumLength(nameof(location),location,1); + await eventListener.AssertNotNull(nameof(privateLinkScopeId),privateLinkScopeId); } } - /// - /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// Updated tag information to set into the PrivateLinkScope 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTags(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateLinkScopesUpdateTags_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// - /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. - /// + /// Returns a Azure Arc PrivateLinkScope. /// - /// Updated tag information to set into the PrivateLinkScope 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var scopeName = _match.Groups["scopeName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + scopeName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateLinkScopesUpdateTags_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// - /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. - /// - /// - /// Updated tag information to set into the PrivateLinkScope instance. - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23754,100 +16715,53 @@ public partial class ConnectedMachine + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.PrivateLinkScopesUpdateTagsWithResult_Call (request, eventListener,sender); - } - } - - /// - /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// Json string supplied to the PrivateLinkScopesUpdateTags operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesUpdateTagsViaJsonString(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateLinkScopesUpdateTags_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Arc PrivateLinkScope resource. - /// Json string supplied to the PrivateLinkScopesUpdateTags operation + /// Returns a Azure Arc PrivateLinkScope. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 PrivateLinkScopesUpdateTagsViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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.HybridCompute/privateLinkScopes/(?[^/]+)$", 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.HybridCompute/privateLinkScopes/{scopeName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" - + global::System.Uri.EscapeDataString(scopeName) + + scopeName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23856,36 +16770,28 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesUpdateTagsWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesGetWithResult_Call (request, eventListener,sender); } } - /// - /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. - /// + /// Returns a Azure Arc PrivateLinkScope. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// Updated tag information to set into the PrivateLinkScope instance. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesGetWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -23905,22 +16811,16 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.PrivateLinkScopesUpdateTagsWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesGetWithResult_Call (request, eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. @@ -23928,7 +16828,7 @@ public partial class ConnectedMachine /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -23980,7 +16880,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -23990,7 +16890,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTags_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -24031,18 +16931,17 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Arc PrivateLinkScope resource. - /// Updated tag information to set into the PrivateLinkScope 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 PrivateLinkScopesUpdateTags_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesGet_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -24053,18 +16952,50 @@ public partial class ConnectedMachine await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(scopeName),scopeName); await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Returns the base Settings for the target resource. + /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. + /// 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.ConnectedMachine.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 PrivateLinkScopesList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + { + var apiVersion = @"2024-07-10"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkScopesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. /// a delegate that is 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). @@ -24073,9 +17004,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsGet(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroup(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24085,14 +17016,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24106,11 +17030,11 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SettingsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns the base Settings for the target resource. + /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -24120,41 +17044,30 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsGetViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroupViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.HybridCompute/settings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes$", 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/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var baseProvider = _match.Groups["baseProvider"].Value; - var baseResourceType = _match.Groups["baseResourceType"].Value; - var baseResourceName = _match.Groups["baseResourceName"].Value; - var settingsResourceName = _match.Groups["settingsResourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/" - + baseProvider - + "/" - + baseResourceType - + "/" - + baseResourceName - + "/providers/Microsoft.HybridCompute/settings/" - + settingsResourceName + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24168,53 +17081,42 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SettingsGet_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns the base Settings for the target resource. + /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.HybridCompute/settings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes$", 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/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var baseProvider = _match.Groups["baseProvider"].Value; - var baseResourceType = _match.Groups["baseResourceType"].Value; - var baseResourceName = _match.Groups["baseResourceName"].Value; - var settingsResourceName = _match.Groups["settingsResourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/" - + baseProvider - + "/" - + baseResourceType - + "/" - + baseResourceName - + "/providers/Microsoft.HybridCompute/settings/" - + settingsResourceName + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24228,26 +17130,22 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.SettingsGetWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// Returns the base Settings for the target resource. + /// Gets a list of Azure Arc PrivateLinkScopes within a resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsGetWithResult(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24257,14 +17155,7 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24278,19 +17169,21 @@ public partial class ConnectedMachine await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.SettingsGetWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -24309,7 +17202,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -24342,7 +17235,9 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -24352,7 +17247,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SettingsGet_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroup_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -24371,7 +17266,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -24393,144 +17288,58 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// 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 SettingsGet_Validate(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(baseProvider),baseProvider); - await eventListener.AssertRegEx(nameof(baseProvider), baseProvider, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(baseResourceType),baseResourceType); - await eventListener.AssertRegEx(nameof(baseResourceType), baseResourceType, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(baseResourceName),baseResourceName); - await eventListener.AssertRegEx(nameof(baseResourceName), baseResourceName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(settingsResourceName),settingsResourceName); - await eventListener.AssertRegEx(nameof(settingsResourceName), settingsResourceName, @"default"); - } - } - - /// patch the base Settings of the target resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details - /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task SettingsPatch(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) - { - var apiVersion = @"2024-05-20-preview"; - // 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/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.SettingsPatch_Call (request, onOk,onDefault,eventListener,sender); + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkScopesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); } } - /// patch the base Settings of the target resource. + /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. /// - /// Settings details /// a delegate that is 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.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsPatchViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesListViaIdentity(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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.HybridCompute/settings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes$", 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/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var baseProvider = _match.Groups["baseProvider"].Value; - var baseResourceType = _match.Groups["baseResourceType"].Value; - var baseResourceName = _match.Groups["baseResourceName"].Value; - var settingsResourceName = _match.Groups["settingsResourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/" - + baseProvider - + "/" - + baseResourceType - + "/" - + baseResourceName - + "/providers/Microsoft.HybridCompute/settings/" - + settingsResourceName + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24539,176 +17348,44 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SettingsPatch_Call (request, onOk,onDefault,eventListener,sender); + await this.PrivateLinkScopesList_Call (request, onOk,onDefault,eventListener,sender); } } - /// patch the base Settings of the target resource. + /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. /// - /// Settings details /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsPatchViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.HybridCompute/settings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes$", 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/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var baseProvider = _match.Groups["baseProvider"].Value; - var baseResourceType = _match.Groups["baseResourceType"].Value; - var baseResourceName = _match.Groups["baseResourceName"].Value; - var settingsResourceName = _match.Groups["settingsResourceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/" - + baseProvider - + "/" - + baseResourceType - + "/" - + baseResourceName - + "/providers/Microsoft.HybridCompute/settings/" - + settingsResourceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the call - return await this.SettingsPatchWithResult_Call (request, eventListener,sender); - } - } - - /// patch the base Settings of the target resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Json string supplied to the SettingsPatch operation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsPatchViaJsonString(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.SettingsPatch_Call (request, onOk,onDefault,eventListener,sender); - } - } - - /// patch the base Settings of the target resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Json string supplied to the SettingsPatch operation - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsPatchViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) - { - var apiVersion = @"2024-05-20-preview"; - // 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/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24717,37 +17394,26 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.SettingsPatchWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesListWithResult_Call (request, eventListener,sender); } } - /// patch the base Settings of the target resource. + /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsPatchWithResult(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24755,16 +17421,7 @@ public partial class ConnectedMachine var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24773,28 +17430,24 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.SettingsPatchWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesListWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsPatchWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -24813,7 +17466,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -24846,7 +17499,7 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -24856,7 +17509,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SettingsPatch_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesList_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -24875,7 +17528,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -24897,52 +17550,31 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details /// 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 SettingsPatch_Validate(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(baseProvider),baseProvider); - await eventListener.AssertRegEx(nameof(baseProvider), baseProvider, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(baseResourceType),baseResourceType); - await eventListener.AssertRegEx(nameof(baseResourceType), baseResourceType, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(baseResourceName),baseResourceName); - await eventListener.AssertRegEx(nameof(baseResourceName), baseResourceName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(settingsResourceName),settingsResourceName); - await eventListener.AssertRegEx(nameof(settingsResourceName), settingsResourceName, @"default"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// update the base Settings of the target resource. + /// + /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details + /// The name of the Azure Arc PrivateLinkScope resource. + /// Updated tag information to set into the PrivateLinkScope instance. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -24951,9 +17583,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsUpdate(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTags(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -24963,14 +17595,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24979,7 +17605,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -24988,15 +17614,16 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SettingsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + await this.PrivateLinkScopesUpdateTags_Call (request, onOk,onDefault,eventListener,sender); } } - /// update the base Settings of the target resource. + /// + /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. + /// /// - /// Settings details + /// Updated tag information to set into the PrivateLinkScope instance. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -25005,41 +17632,32 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.HybridCompute/settings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)$", 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/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var baseProvider = _match.Groups["baseProvider"].Value; - var baseResourceType = _match.Groups["baseResourceType"].Value; - var baseResourceName = _match.Groups["baseResourceName"].Value; - var settingsResourceName = _match.Groups["settingsResourceName"].Value; + var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/" - + baseProvider - + "/" - + baseResourceType - + "/" - + baseResourceName - + "/providers/Microsoft.HybridCompute/settings/" - + settingsResourceName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25048,7 +17666,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -25057,55 +17675,48 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SettingsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + await this.PrivateLinkScopesUpdateTags_Call (request, onOk,onDefault,eventListener,sender); } } - /// update the base Settings of the target resource. + /// + /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. + /// /// - /// Settings details + /// Updated tag information to set into the PrivateLinkScope instance. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // 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/(?[^/]+)/(?[^/]+)/(?[^/]+)/providers/Microsoft.HybridCompute/settings/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.HybridCompute/privateLinkScopes/(?[^/]+)$", 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/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var baseProvider = _match.Groups["baseProvider"].Value; - var baseResourceType = _match.Groups["baseResourceType"].Value; - var baseResourceName = _match.Groups["baseResourceName"].Value; - var settingsResourceName = _match.Groups["settingsResourceName"].Value; + var scopeName = _match.Groups["scopeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/" - + baseProvider - + "/" - + baseResourceType - + "/" - + baseResourceName - + "/providers/Microsoft.HybridCompute/settings/" - + settingsResourceName + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + scopeName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25114,7 +17725,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -25123,20 +17734,18 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.SettingsUpdateWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesUpdateTagsWithResult_Call (request, eventListener,sender); } } - /// update the base Settings of the target resource. + /// + /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Json string supplied to the SettingsUpdate operation + /// The name of the Azure Arc PrivateLinkScope resource. + /// Json string supplied to the PrivateLinkScopesUpdateTags operation /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -25144,9 +17753,9 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsViaJsonString(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25156,14 +17765,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25172,7 +17775,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -25181,27 +17784,26 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.SettingsUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + await this.PrivateLinkScopesUpdateTags_Call (request, onOk,onDefault,eventListener,sender); } } - /// update the base Settings of the target resource. + /// + /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Json string supplied to the SettingsUpdate operation + /// The name of the Azure Arc PrivateLinkScope resource. + /// Json string supplied to the PrivateLinkScopesUpdateTags operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string scopeName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25211,14 +17813,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25227,7 +17823,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -25236,28 +17832,27 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.SettingsUpdateWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesUpdateTagsWithResult_Call (request, eventListener,sender); } } - /// update the base Settings of the target resource. + /// + /// update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method. + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details + /// The name of the Azure Arc PrivateLinkScope resource. + /// Updated tag information to set into the PrivateLinkScope instance. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync pipeline to use to make the request. /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task SettingsUpdateWithResult(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsWithResult(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25267,14 +17862,8 @@ public partial class ConnectedMachine + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/" - + global::System.Uri.EscapeDataString(baseProvider) - + "/" - + global::System.Uri.EscapeDataString(baseResourceType) - + "/" - + global::System.Uri.EscapeDataString(baseResourceName) - + "/providers/Microsoft.HybridCompute/settings/" - + global::System.Uri.EscapeDataString(settingsResourceName) + + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + + global::System.Uri.EscapeDataString(scopeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25283,7 +17872,7 @@ public partial class ConnectedMachine // 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.ConnectedMachine.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } @@ -25292,19 +17881,21 @@ public partial class ConnectedMachine request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - return await this.SettingsUpdateWithResult_Call (request, eventListener,sender); + return await this.PrivateLinkScopesUpdateTagsWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 SettingsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTagsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -25323,13 +17914,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); - return await _result; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) ); return await _result; } default: @@ -25362,10 +17947,9 @@ public partial class ConnectedMachine } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -25373,7 +17957,7 @@ public partial class ConnectedMachine /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task SettingsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTags_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.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -25392,13 +17976,7 @@ public partial class ConnectedMachine case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Settings.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridComputePrivateLinkScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -25420,21 +17998,18 @@ public partial class ConnectedMachine } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details + /// The name of the Azure Arc PrivateLinkScope resource. + /// Updated tag information to set into the PrivateLinkScope 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 SettingsUpdate_Validate(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateLinkScopesUpdateTags_Validate(string subscriptionId, string resourceGroupName, string scopeName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource body, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -25443,14 +18018,8 @@ public partial class ConnectedMachine await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(baseProvider),baseProvider); - await eventListener.AssertRegEx(nameof(baseProvider), baseProvider, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(baseResourceType),baseResourceType); - await eventListener.AssertRegEx(nameof(baseResourceType), baseResourceType, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(baseResourceName),baseResourceName); - await eventListener.AssertRegEx(nameof(baseResourceName), baseResourceName, @"[a-zA-Z0-9-_\.]+"); - await eventListener.AssertNotNull(nameof(settingsResourceName),settingsResourceName); - await eventListener.AssertRegEx(nameof(settingsResourceName), settingsResourceName, @"default"); + await eventListener.AssertNotNull(nameof(scopeName),scopeName); + await eventListener.AssertRegEx(nameof(scopeName), scopeName, @"[a-zA-Z0-9-_\.]+"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -25472,7 +18041,7 @@ public partial class ConnectedMachine /// public async global::System.Threading.Tasks.Task UpgradeExtensions(string subscriptionId, string resourceGroupName, string machineName, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25520,7 +18089,7 @@ public partial class ConnectedMachine /// public async global::System.Threading.Tasks.Task UpgradeExtensionsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { @@ -25581,7 +18150,7 @@ public partial class ConnectedMachine /// public async global::System.Threading.Tasks.Task UpgradeExtensionsViaJsonString(string subscriptionId, string resourceGroupName, string machineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.ISendAsync sender) { - var apiVersion = @"2024-05-20-preview"; + var apiVersion = @"2024-07-10"; // Constant Parameters using( NoSynchronizationContext ) { diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.PowerShell.cs deleted file mode 100644 index 640c5275b44f..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.PowerShell.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes properties of Agent Version. - [System.ComponentModel.TypeConverter(typeof(AgentVersionTypeConverter))] - public partial class AgentVersion - { - - /// - /// 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 AgentVersion(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AgentVersion1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).AgentVersion1 = (string) content.GetValueForProperty("AgentVersion1",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).AgentVersion1, global::System.Convert.ToString); - } - if (content.Contains("DownloadLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).DownloadLink = (string) content.GetValueForProperty("DownloadLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).DownloadLink, global::System.Convert.ToString); - } - if (content.Contains("OSType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).OSType, 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 AgentVersion(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AgentVersion1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).AgentVersion1 = (string) content.GetValueForProperty("AgentVersion1",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).AgentVersion1, global::System.Convert.ToString); - } - if (content.Contains("DownloadLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).DownloadLink = (string) content.GetValueForProperty("DownloadLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).DownloadLink, global::System.Convert.ToString); - } - if (content.Contains("OSType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal)this).OSType, 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.ConnectedMachine.Models.IAgentVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgentVersion(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.ConnectedMachine.Models.IAgentVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgentVersion(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.ConnectedMachine.Models.IAgentVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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 properties of Agent Version. - [System.ComponentModel.TypeConverter(typeof(AgentVersionTypeConverter))] - public partial interface IAgentVersion - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.TypeConverter.cs deleted file mode 100644 index 9d41b7e7f9b0..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class AgentVersionTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return AgentVersion.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return AgentVersion.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return AgentVersion.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.cs deleted file mode 100644 index fa7500072ce7..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes properties of Agent Version. - public partial class AgentVersion : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionInternal - { - - /// Backing field for property. - private string _agentVersion1; - - /// Represents the agent version. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string AgentVersion1 { get => this._agentVersion1; set => this._agentVersion1 = value; } - - /// Backing field for property. - private string _downloadLink; - - /// Represents the download link of specific agent version. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string DownloadLink { get => this._downloadLink; set => this._downloadLink = value; } - - /// Backing field for property. - private string _oSType; - - /// Defines the os type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string OSType { get => this._oSType; set => this._oSType = value; } - - /// Creates an new instance. - public AgentVersion() - { - - } - } - /// Describes properties of Agent Version. - public partial interface IAgentVersion : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Represents the agent version. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Represents the agent version.", - SerializedName = @"agentVersion", - PossibleTypes = new [] { typeof(string) })] - string AgentVersion1 { get; set; } - /// Represents the download link of specific agent version. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Represents the download link of specific agent version.", - SerializedName = @"downloadLink", - PossibleTypes = new [] { typeof(string) })] - string DownloadLink { get; set; } - /// Defines the os type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Defines the os type.", - SerializedName = @"osType", - PossibleTypes = new [] { typeof(string) })] - string OSType { get; set; } - - } - /// Describes properties of Agent Version. - internal partial interface IAgentVersionInternal - - { - /// Represents the agent version. - string AgentVersion1 { get; set; } - /// Represents the download link of specific agent version. - string DownloadLink { get; set; } - /// Defines the os type. - string OSType { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.json.cs deleted file mode 100644 index 849f66ec9621..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersion.json.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes properties of Agent Version. - public partial class AgentVersion - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal AgentVersion(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_agentVersion1 = If( json?.PropertyT("agentVersion"), out var __jsonAgentVersion) ? (string)__jsonAgentVersion : (string)_agentVersion1;} - {_downloadLink = If( json?.PropertyT("downloadLink"), out var __jsonDownloadLink) ? (string)__jsonDownloadLink : (string)_downloadLink;} - {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)_oSType;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new AgentVersion(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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._agentVersion1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._agentVersion1.ToString()) : null, "agentVersion" ,container.Add ); - AddIf( null != (((object)this._downloadLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._downloadLink.ToString()) : null, "downloadLink" ,container.Add ); - AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.PowerShell.cs deleted file mode 100644 index 41796f1f05de..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.PowerShell.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes AgentVersions List. - [System.ComponentModel.TypeConverter(typeof(AgentVersionsListTypeConverter))] - public partial class AgentVersionsList - { - - /// - /// 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 AgentVersionsList(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.ConnectedMachine.Models.IAgentVersionsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsListInternal)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 AgentVersionsList(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.ConnectedMachine.Models.IAgentVersionsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsListInternal)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.ConnectedMachine.Models.IAgentVersionsList DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgentVersionsList(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.ConnectedMachine.Models.IAgentVersionsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgentVersionsList(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.ConnectedMachine.Models.IAgentVersionsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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 AgentVersions List. - [System.ComponentModel.TypeConverter(typeof(AgentVersionsListTypeConverter))] - public partial interface IAgentVersionsList - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.TypeConverter.cs deleted file mode 100644 index e4c33e73e792..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class AgentVersionsListTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsList ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsList).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return AgentVersionsList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return AgentVersionsList.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return AgentVersionsList.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.cs deleted file mode 100644 index 13d71aae4e4e..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes AgentVersions List. - public partial class AgentVersionsList : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsList, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The URI to fetch the next 10 available Agent Versions. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private System.Collections.Generic.List _value; - - /// The list of available Agent Versions. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public AgentVersionsList() - { - - } - } - /// Describes AgentVersions List. - public partial interface IAgentVersionsList : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// The URI to fetch the next 10 available Agent Versions. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The URI to fetch the next 10 available Agent Versions.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of available Agent Versions. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The list of available Agent Versions.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion) })] - System.Collections.Generic.List Value { get; set; } - - } - /// Describes AgentVersions List. - internal partial interface IAgentVersionsListInternal - - { - /// The URI to fetch the next 10 available Agent Versions. - string NextLink { get; set; } - /// The list of available Agent Versions. - System.Collections.Generic.List Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.json.cs deleted file mode 100644 index 307549f20344..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/AgentVersionsList.json.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes AgentVersions List. - public partial class AgentVersionsList - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal AgentVersionsList(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersion) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.AgentVersion.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.ConnectedMachine.Models.IAgentVersionsList. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsList. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IAgentVersionsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new AgentVersionsList(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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.PowerShell.cs index a27ba038f831..b151cde2ef24 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.PowerShell.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.PowerShell.cs @@ -119,38 +119,6 @@ internal ConnectedMachineIdentity(global::System.Collections.IDictionary content { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).Version, global::System.Convert.ToString); } - if (content.Contains("MetadataName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).MetadataName = (string) content.GetValueForProperty("MetadataName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).MetadataName, global::System.Convert.ToString); - } - if (content.Contains("OSType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).OSType, global::System.Convert.ToString); - } - if (content.Contains("RunCommandName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).RunCommandName = (string) content.GetValueForProperty("RunCommandName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).RunCommandName, global::System.Convert.ToString); - } - if (content.Contains("GatewayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).GatewayName = (string) content.GetValueForProperty("GatewayName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).GatewayName, global::System.Convert.ToString); - } - if (content.Contains("BaseProvider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseProvider = (string) content.GetValueForProperty("BaseProvider",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseProvider, global::System.Convert.ToString); - } - if (content.Contains("BaseResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceType = (string) content.GetValueForProperty("BaseResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceType, global::System.Convert.ToString); - } - if (content.Contains("BaseResourceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceName = (string) content.GetValueForProperty("BaseResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceName, global::System.Convert.ToString); - } - if (content.Contains("SettingsResourceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).SettingsResourceName = (string) content.GetValueForProperty("SettingsResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).SettingsResourceName, global::System.Convert.ToString); - } if (content.Contains("ScopeName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ScopeName = (string) content.GetValueForProperty("ScopeName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ScopeName, global::System.Convert.ToString); @@ -167,10 +135,6 @@ internal ConnectedMachineIdentity(global::System.Collections.IDictionary content { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); } - if (content.Contains("ResourceUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ResourceUri = (string) content.GetValueForProperty("ResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ResourceUri, global::System.Convert.ToString); - } if (content.Contains("PerimeterName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PerimeterName = (string) content.GetValueForProperty("PerimeterName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PerimeterName, global::System.Convert.ToString); @@ -240,38 +204,6 @@ internal ConnectedMachineIdentity(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).Version, global::System.Convert.ToString); } - if (content.Contains("MetadataName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).MetadataName = (string) content.GetValueForProperty("MetadataName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).MetadataName, global::System.Convert.ToString); - } - if (content.Contains("OSType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).OSType, global::System.Convert.ToString); - } - if (content.Contains("RunCommandName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).RunCommandName = (string) content.GetValueForProperty("RunCommandName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).RunCommandName, global::System.Convert.ToString); - } - if (content.Contains("GatewayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).GatewayName = (string) content.GetValueForProperty("GatewayName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).GatewayName, global::System.Convert.ToString); - } - if (content.Contains("BaseProvider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseProvider = (string) content.GetValueForProperty("BaseProvider",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseProvider, global::System.Convert.ToString); - } - if (content.Contains("BaseResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceType = (string) content.GetValueForProperty("BaseResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceType, global::System.Convert.ToString); - } - if (content.Contains("BaseResourceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceName = (string) content.GetValueForProperty("BaseResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).BaseResourceName, global::System.Convert.ToString); - } - if (content.Contains("SettingsResourceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).SettingsResourceName = (string) content.GetValueForProperty("SettingsResourceName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).SettingsResourceName, global::System.Convert.ToString); - } if (content.Contains("ScopeName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ScopeName = (string) content.GetValueForProperty("ScopeName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ScopeName, global::System.Convert.ToString); @@ -288,10 +220,6 @@ internal ConnectedMachineIdentity(global::System.Management.Automation.PSObject { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); } - if (content.Contains("ResourceUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ResourceUri = (string) content.GetValueForProperty("ResourceUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).ResourceUri, global::System.Convert.ToString); - } if (content.Contains("PerimeterName")) { ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PerimeterName = (string) content.GetValueForProperty("PerimeterName",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal)this).PerimeterName, global::System.Convert.ToString); diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.cs index 2ec54421bc62..98e3ed7d5115 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.cs @@ -12,27 +12,6 @@ public partial class ConnectedMachineIdentity : Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentityInternal { - /// Backing field for property. - private string _baseProvider; - - /// The name of the base Resource Provider. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string BaseProvider { get => this._baseProvider; set => this._baseProvider = value; } - - /// Backing field for property. - private string _baseResourceName; - - /// The name of the base resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string BaseResourceName { get => this._baseResourceName; set => this._baseResourceName = value; } - - /// Backing field for property. - private string _baseResourceType; - - /// The name of the base Resource Type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string BaseResourceType { get => this._baseResourceType; set => this._baseResourceType = value; } - /// Backing field for property. private string _extensionName; @@ -47,13 +26,6 @@ public partial class ConnectedMachineIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] public string ExtensionType { get => this._extensionType; set => this._extensionType = value; } - /// Backing field for property. - private string _gatewayName; - - /// The name of the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string GatewayName { get => this._gatewayName; set => this._gatewayName = value; } - /// Backing field for property. private string _groupName; @@ -96,13 +68,6 @@ public partial class ConnectedMachineIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] public string MachineName { get => this._machineName; set => this._machineName = value; } - /// Backing field for property. - private string _metadataName; - - /// Name of the HybridIdentityMetadata. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string MetadataName { get => this._metadataName; set => this._metadataName = value; } - /// Backing field for property. private string _name; @@ -110,13 +75,6 @@ public partial class ConnectedMachineIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] public string Name { get => this._name; set => this._name = value; } - /// Backing field for property. - private string _oSType; - - /// Defines the os type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string OSType { get => this._oSType; set => this._oSType = value; } - /// Backing field for property. private string _perimeterName; @@ -154,22 +112,6 @@ public partial class ConnectedMachineIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - /// Backing field for property. - private string _resourceUri; - - /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ResourceUri { get => this._resourceUri; set => this._resourceUri = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - /// Backing field for property. private string _scopeName; @@ -177,13 +119,6 @@ public partial class ConnectedMachineIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] public string ScopeName { get => this._scopeName; set => this._scopeName = value; } - /// Backing field for property. - private string _settingsResourceName; - - /// The name of the settings resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string SettingsResourceName { get => this._settingsResourceName; set => this._settingsResourceName = value; } - /// Backing field for property. private string _subscriptionId; @@ -207,39 +142,6 @@ public ConnectedMachineIdentity() public partial interface IConnectedMachineIdentity : Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable { - /// The name of the base Resource Provider. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The name of the base Resource Provider.", - SerializedName = @"baseProvider", - PossibleTypes = new [] { typeof(string) })] - string BaseProvider { get; set; } - /// The name of the base resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The name of the base resource.", - SerializedName = @"baseResourceName", - PossibleTypes = new [] { typeof(string) })] - string BaseResourceName { get; set; } - /// The name of the base Resource Type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The name of the base Resource Type.", - SerializedName = @"baseResourceType", - PossibleTypes = new [] { typeof(string) })] - string BaseResourceType { get; set; } /// The name of the machine extension. [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( Required = false, @@ -262,17 +164,6 @@ public partial interface IConnectedMachineIdentity : SerializedName = @"extensionType", PossibleTypes = new [] { typeof(string) })] string ExtensionType { get; set; } - /// The name of the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The name of the Gateway.", - SerializedName = @"gatewayName", - PossibleTypes = new [] { typeof(string) })] - string GatewayName { get; set; } /// The name of the private link resource. [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( Required = false, @@ -340,17 +231,6 @@ public partial interface IConnectedMachineIdentity : SerializedName = @"machineName", PossibleTypes = new [] { typeof(string) })] string MachineName { get; set; } - /// Name of the HybridIdentityMetadata. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Name of the HybridIdentityMetadata.", - SerializedName = @"metadataName", - PossibleTypes = new [] { typeof(string) })] - string MetadataName { get; set; } /// The name of the hybrid machine. [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( Required = false, @@ -362,17 +242,6 @@ public partial interface IConnectedMachineIdentity : SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] string Name { get; set; } - /// Defines the os type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Defines the os type.", - SerializedName = @"osType", - PossibleTypes = new [] { typeof(string) })] - string OSType { get; set; } /// /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. /// @@ -430,30 +299,6 @@ public partial interface IConnectedMachineIdentity : SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] string ResourceGroupName { get; set; } - /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The fully qualified Azure Resource manager identifier of the resource to be connected.", - SerializedName = @"resourceUri", - PossibleTypes = new [] { typeof(string) })] - string ResourceUri { get; set; } - /// The name of the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - string RunCommandName { get; set; } /// The name of the Azure Arc PrivateLinkScope resource. [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( Required = false, @@ -465,17 +310,6 @@ public partial interface IConnectedMachineIdentity : SerializedName = @"scopeName", PossibleTypes = new [] { typeof(string) })] string ScopeName { get; set; } - /// The name of the settings resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The name of the settings resource.", - SerializedName = @"settingsResourceName", - PossibleTypes = new [] { typeof(string) })] - string SettingsResourceName { get; set; } /// The ID of the target subscription. [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( Required = false, @@ -503,18 +337,10 @@ public partial interface IConnectedMachineIdentity : internal partial interface IConnectedMachineIdentityInternal { - /// The name of the base Resource Provider. - string BaseProvider { get; set; } - /// The name of the base resource. - string BaseResourceName { get; set; } - /// The name of the base Resource Type. - string BaseResourceType { get; set; } /// The name of the machine extension. string ExtensionName { get; set; } /// The extensionType of the Extension being received. string ExtensionType { get; set; } - /// The name of the Gateway. - string GatewayName { get; set; } /// The name of the private link resource. string GroupName { get; set; } /// Resource identity path @@ -528,12 +354,8 @@ internal partial interface IConnectedMachineIdentityInternal string Location { get; set; } /// The name of the hybrid machine. string MachineName { get; set; } - /// Name of the HybridIdentityMetadata. - string MetadataName { get; set; } /// The name of the hybrid machine. string Name { get; set; } - /// Defines the os type. - string OSType { get; set; } /// /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. /// @@ -546,16 +368,8 @@ internal partial interface IConnectedMachineIdentityInternal string Publisher { get; set; } /// The name of the resource group. The name is case insensitive. string ResourceGroupName { get; set; } - /// - /// The fully qualified Azure Resource manager identifier of the resource to be connected. - /// - string ResourceUri { get; set; } - /// The name of the run command. - string RunCommandName { get; set; } /// The name of the Azure Arc PrivateLinkScope resource. string ScopeName { get; set; } - /// The name of the settings resource. - string SettingsResourceName { get; set; } /// The ID of the target subscription. string SubscriptionId { get; set; } /// The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.json.cs index 9412bdcd6f09..f9d178169a0f 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.json.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ConnectedMachineIdentity.json.cs @@ -75,19 +75,10 @@ internal ConnectedMachineIdentity(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMa {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)_publisher;} {_extensionType = If( json?.PropertyT("extensionType"), out var __jsonExtensionType) ? (string)__jsonExtensionType : (string)_extensionType;} {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} - {_metadataName = If( json?.PropertyT("metadataName"), out var __jsonMetadataName) ? (string)__jsonMetadataName : (string)_metadataName;} - {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)_oSType;} - {_runCommandName = If( json?.PropertyT("runCommandName"), out var __jsonRunCommandName) ? (string)__jsonRunCommandName : (string)_runCommandName;} - {_gatewayName = If( json?.PropertyT("gatewayName"), out var __jsonGatewayName) ? (string)__jsonGatewayName : (string)_gatewayName;} - {_baseProvider = If( json?.PropertyT("baseProvider"), out var __jsonBaseProvider) ? (string)__jsonBaseProvider : (string)_baseProvider;} - {_baseResourceType = If( json?.PropertyT("baseResourceType"), out var __jsonBaseResourceType) ? (string)__jsonBaseResourceType : (string)_baseResourceType;} - {_baseResourceName = If( json?.PropertyT("baseResourceName"), out var __jsonBaseResourceName) ? (string)__jsonBaseResourceName : (string)_baseResourceName;} - {_settingsResourceName = If( json?.PropertyT("settingsResourceName"), out var __jsonSettingsResourceName) ? (string)__jsonSettingsResourceName : (string)_settingsResourceName;} {_scopeName = If( json?.PropertyT("scopeName"), out var __jsonScopeName) ? (string)__jsonScopeName : (string)_scopeName;} {_privateLinkScopeId = If( json?.PropertyT("privateLinkScopeId"), out var __jsonPrivateLinkScopeId) ? (string)__jsonPrivateLinkScopeId : (string)_privateLinkScopeId;} {_groupName = If( json?.PropertyT("groupName"), out var __jsonGroupName) ? (string)__jsonGroupName : (string)_groupName;} {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)_privateEndpointConnectionName;} - {_resourceUri = If( json?.PropertyT("resourceUri"), out var __jsonResourceUri) ? (string)__jsonResourceUri : (string)_resourceUri;} {_perimeterName = If( json?.PropertyT("perimeterName"), out var __jsonPerimeterName) ? (string)__jsonPerimeterName : (string)_perimeterName;} {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); @@ -135,19 +126,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode AddIf( null != (((object)this._publisher)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._publisher.ToString()) : null, "publisher" ,container.Add ); AddIf( null != (((object)this._extensionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._extensionType.ToString()) : null, "extensionType" ,container.Add ); AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); - AddIf( null != (((object)this._metadataName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._metadataName.ToString()) : null, "metadataName" ,container.Add ); - AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add ); - AddIf( null != (((object)this._runCommandName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._runCommandName.ToString()) : null, "runCommandName" ,container.Add ); - AddIf( null != (((object)this._gatewayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._gatewayName.ToString()) : null, "gatewayName" ,container.Add ); - AddIf( null != (((object)this._baseProvider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._baseProvider.ToString()) : null, "baseProvider" ,container.Add ); - AddIf( null != (((object)this._baseResourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._baseResourceType.ToString()) : null, "baseResourceType" ,container.Add ); - AddIf( null != (((object)this._baseResourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._baseResourceName.ToString()) : null, "baseResourceName" ,container.Add ); - AddIf( null != (((object)this._settingsResourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._settingsResourceName.ToString()) : null, "settingsResourceName" ,container.Add ); AddIf( null != (((object)this._scopeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._scopeName.ToString()) : null, "scopeName" ,container.Add ); AddIf( null != (((object)this._privateLinkScopeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._privateLinkScopeId.ToString()) : null, "privateLinkScopeId" ,container.Add ); AddIf( null != (((object)this._groupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._groupName.ToString()) : null, "groupName" ,container.Add ); AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); - AddIf( null != (((object)this._resourceUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._resourceUri.ToString()) : null, "resourceUri" ,container.Add ); AddIf( null != (((object)this._perimeterName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._perimeterName.ToString()) : null, "perimeterName" ,container.Add ); AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); AfterToJson(ref container); diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.PowerShell.cs deleted file mode 100644 index e9e205cab7e4..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.PowerShell.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// The error detail. - [System.ComponentModel.TypeConverter(typeof(ErrorDetailAutoGeneratedTypeConverter))] - public partial class ErrorDetailAutoGenerated - { - - /// - /// 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.ConnectedMachine.Models.IErrorDetailAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorDetailAutoGenerated(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.ConnectedMachine.Models.IErrorDetailAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorDetailAutoGenerated(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorDetailAutoGenerated(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.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGeneratedTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorDetailAutoGenerated(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.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGeneratedTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorAdditionalInfoTypeConverter.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.ConnectedMachine.Models.IErrorDetailAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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 error detail. - [System.ComponentModel.TypeConverter(typeof(ErrorDetailAutoGeneratedTypeConverter))] - public partial interface IErrorDetailAutoGenerated - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.TypeConverter.cs deleted file mode 100644 index 7098663e5c0e..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ErrorDetailAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return ErrorDetailAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return ErrorDetailAutoGenerated.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return ErrorDetailAutoGenerated.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.cs deleted file mode 100644 index d1a95867d2e5..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// The error detail. - public partial class ErrorDetailAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal - { - - /// Backing field for property. - private System.Collections.Generic.List _additionalInfo; - - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; } - - /// Backing field for property. - private string _code; - - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Code { get => this._code; } - - /// Backing field for property. - private System.Collections.Generic.List _detail; - - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List Detail { get => this._detail; } - - /// Backing field for property. - private string _message; - - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Message { get => this._message; } - - /// Internal Acessors for AdditionalInfo - System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal.Code { get => this._code; set { {_code = value;} } } - - /// Internal Acessors for Detail - System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal.Detail { get => this._detail; set { {_detail = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal.Message { get => this._message; set { {_message = value;} } } - - /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal.Target { get => this._target; set { {_target = value;} } } - - /// Backing field for property. - private string _target; - - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Target { get => this._target; } - - /// Creates an new instance. - public ErrorDetailAutoGenerated() - { - - } - } - /// The error detail. - public partial interface IErrorDetailAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error additional info.", - SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorAdditionalInfo) })] - System.Collections.Generic.List AdditionalInfo { get; } - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error details.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated) })] - System.Collections.Generic.List Detail { get; } - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error message.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error target.", - SerializedName = @"target", - PossibleTypes = new [] { typeof(string) })] - string Target { get; } - - } - /// The error detail. - internal partial interface IErrorDetailAutoGeneratedInternal - - { - /// The error additional info. - System.Collections.Generic.List AdditionalInfo { get; set; } - /// The error code. - string Code { get; set; } - /// The error details. - System.Collections.Generic.List Detail { get; set; } - /// The error message. - string Message { get; set; } - /// The error target. - string Target { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.json.cs deleted file mode 100644 index 08fb7cfbf3b0..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorDetailAutoGenerated.json.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// The error detail. - public partial class ErrorDetailAutoGenerated - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal ErrorDetailAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGenerated.FromJson(__u) )) ))() : null : _detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new ErrorDetailAutoGenerated(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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - if (null != this._detail) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.XNodeArray(); - foreach( var __x in this._detail ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("details",__w); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - if (null != this._additionalInfo) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.XNodeArray(); - foreach( var __s in this._additionalInfo ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("additionalInfo",__r); - } - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.PowerShell.cs deleted file mode 100644 index d914aeb0f6a1..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.PowerShell.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - /// - [System.ComponentModel.TypeConverter(typeof(ErrorResponseAutoGeneratedTypeConverter))] - public partial class ErrorResponseAutoGenerated - { - - /// - /// 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.ConnectedMachine.Models.IErrorResponseAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorResponseAutoGenerated(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.ConnectedMachine.Models.IErrorResponseAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorResponseAutoGenerated(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorResponseAutoGenerated(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.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGeneratedTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorResponseAutoGenerated(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.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGeneratedTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGeneratedTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorAdditionalInfoTypeConverter.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.ConnectedMachine.Models.IErrorResponseAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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 error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - [System.ComponentModel.TypeConverter(typeof(ErrorResponseAutoGeneratedTypeConverter))] - public partial interface IErrorResponseAutoGenerated - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.TypeConverter.cs deleted file mode 100644 index 1b5891d5fb9a..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ErrorResponseAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGenerated ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGenerated).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return ErrorResponseAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return ErrorResponseAutoGenerated.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return ErrorResponseAutoGenerated.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.cs deleted file mode 100644 index df7cba0bfce2..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - /// - public partial class ErrorResponseAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGenerated, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal - { - - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).AdditionalInfo; } - - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Code; } - - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Detail; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated _error; - - /// The error object. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGenerated()); set => this._error = value; } - - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Message; } - - /// Internal Acessors for AdditionalInfo - System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).AdditionalInfo = value; } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Code = value; } - - /// Internal Acessors for Detail - System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Detail = value; } - - /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ErrorDetailAutoGenerated()); set { {_error = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Message = value; } - - /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGeneratedInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Target = value; } - - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGeneratedInternal)Error).Target; } - - /// Creates an new instance. - public ErrorResponseAutoGenerated() - { - - } - } - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - public partial interface IErrorResponseAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error additional info.", - SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorAdditionalInfo) })] - System.Collections.Generic.List AdditionalInfo { get; } - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error details.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated) })] - System.Collections.Generic.List Detail { get; } - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error message.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The error target.", - SerializedName = @"target", - PossibleTypes = new [] { typeof(string) })] - string Target { get; } - - } - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - internal partial interface IErrorResponseAutoGeneratedInternal - - { - /// The error additional info. - System.Collections.Generic.List AdditionalInfo { get; set; } - /// The error code. - string Code { get; set; } - /// The error details. - System.Collections.Generic.List Detail { get; set; } - /// The error object. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorDetailAutoGenerated Error { get; set; } - /// The error message. - string Message { get; set; } - /// The error target. - string Target { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.json.cs deleted file mode 100644 index 8b6cb4fadd85..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/ErrorResponseAutoGenerated.json.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - /// - public partial class ErrorResponseAutoGenerated - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal ErrorResponseAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Models.ErrorDetailAutoGenerated.FromJson(__jsonError) : _error;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGenerated. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGenerated. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponseAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new ErrorResponseAutoGenerated(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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.PowerShell.cs deleted file mode 100644 index 5efbbdbe4ef8..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.PowerShell.cs +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes an Arc Gateway. - [System.ComponentModel.TypeConverter(typeof(GatewayTypeConverter))] - public partial class Gateway - { - - /// - /// 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.ConnectedMachine.Models.IGateway DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Gateway(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.ConnectedMachine.Models.IGateway DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Gateway(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.ConnectedMachine.Models.IGateway FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Gateway(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.ConnectedMachine.Models.IGatewayInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("GatewayType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayType = (string) content.GetValueForProperty("GatewayType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayType, global::System.Convert.ToString); - } - if (content.Contains("GatewayId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayId = (string) content.GetValueForProperty("GatewayId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayId, global::System.Convert.ToString); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).Endpoint, global::System.Convert.ToString); - } - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Gateway(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.ConnectedMachine.Models.IGatewayInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("GatewayType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayType = (string) content.GetValueForProperty("GatewayType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayType, global::System.Convert.ToString); - } - if (content.Contains("GatewayId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayId = (string) content.GetValueForProperty("GatewayId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).GatewayId, global::System.Convert.ToString); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).Endpoint = (string) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).Endpoint, global::System.Convert.ToString); - } - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 an Arc Gateway. - [System.ComponentModel.TypeConverter(typeof(GatewayTypeConverter))] - public partial interface IGateway - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.TypeConverter.cs deleted file mode 100644 index bd78eef7f161..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.TypeConverter.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class GatewayTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Gateway.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Gateway.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Gateway.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.cs deleted file mode 100644 index 8dbc99573de1..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.cs +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes an Arc Gateway. - public partial class Gateway : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated __trackedResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceAutoGenerated(); - - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List AllowedFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).AllowedFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).AllowedFeature = value ?? null /* arrayOf */; } - - /// The endpoint fqdn for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayEndpoint; } - - /// A unique, immutable, identifier for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string GatewayId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayId; } - - /// The type of the Gateway resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string GatewayType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayType = value ?? null; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Location = value ; } - - /// Internal Acessors for Endpoint - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal.Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayEndpoint = value; } - - /// Internal Acessors for GatewayId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal.GatewayId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).GatewayId = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties _property; - - /// Hybrid Compute Gateway properties - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayProperties()); set => this._property = value; } - - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataCreatedByType = value ?? null; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).SystemDataLastModifiedByType = value ?? null; } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tags { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Tags; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Tags = value ?? null /* model class */; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__trackedResourceAutoGenerated).Type; } - - /// Creates an new instance. - public Gateway() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResourceAutoGenerated), __trackedResourceAutoGenerated); - await eventListener.AssertObjectIsValid(nameof(__trackedResourceAutoGenerated), __trackedResourceAutoGenerated); - } - } - /// Describes an Arc Gateway. - public partial interface IGateway : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated - { - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the list of features that are enabled for this Gateway.", - SerializedName = @"allowedFeatures", - PossibleTypes = new [] { typeof(string) })] - System.Collections.Generic.List AllowedFeature { get; set; } - /// The endpoint fqdn for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The endpoint fqdn for the Gateway.", - SerializedName = @"gatewayEndpoint", - PossibleTypes = new [] { typeof(string) })] - string Endpoint { get; } - /// A unique, immutable, identifier for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"A unique, immutable, identifier for the Gateway.", - SerializedName = @"gatewayId", - PossibleTypes = new [] { typeof(string) })] - string GatewayId { get; } - /// The type of the Gateway resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The type of the Gateway resource.", - SerializedName = @"gatewayType", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Public")] - string GatewayType { get; set; } - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The provisioning state, which only appears in the response.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Creating", "Updating", "Deleting", "Succeeded", "Failed", "Accepted", "Canceled", "Deleted")] - string ProvisioningState { get; } - - } - /// Describes an Arc Gateway. - internal partial interface IGatewayInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal - { - /// Specifies the list of features that are enabled for this Gateway. - System.Collections.Generic.List AllowedFeature { get; set; } - /// The endpoint fqdn for the Gateway. - string Endpoint { get; set; } - /// A unique, immutable, identifier for the Gateway. - string GatewayId { get; set; } - /// The type of the Gateway resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Public")] - string GatewayType { get; set; } - /// Hybrid Compute Gateway properties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties Property { get; set; } - /// The provisioning state, which only appears in the response. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Creating", "Updating", "Deleting", "Succeeded", "Failed", "Accepted", "Canceled", "Deleted")] - string ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.json.cs deleted file mode 100644 index 439e3e685d6a..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Gateway.json.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes an Arc Gateway. - public partial class Gateway - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new Gateway(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal Gateway(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __trackedResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceAutoGenerated(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayProperties.FromJson(__jsonProperties) : _property;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __trackedResourceAutoGenerated?.ToJson(container, serializationMode); - AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.PowerShell.cs deleted file mode 100644 index 7a2b081cda70..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.PowerShell.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes the properties of a Gateway Profile. - [System.ComponentModel.TypeConverter(typeof(GatewayPropertiesTypeConverter))] - public partial class GatewayProperties - { - - /// - /// 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.ConnectedMachine.Models.IGatewayProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new GatewayProperties(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.ConnectedMachine.Models.IGatewayProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new GatewayProperties(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.ConnectedMachine.Models.IGatewayProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal GatewayProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("GatewayId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayId = (string) content.GetValueForProperty("GatewayId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayId, global::System.Convert.ToString); - } - if (content.Contains("GatewayType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayType = (string) content.GetValueForProperty("GatewayType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayType, global::System.Convert.ToString); - } - if (content.Contains("GatewayEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayEndpoint = (string) content.GetValueForProperty("GatewayEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayEndpoint, global::System.Convert.ToString); - } - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal GatewayProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("GatewayId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayId = (string) content.GetValueForProperty("GatewayId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayId, global::System.Convert.ToString); - } - if (content.Contains("GatewayType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayType = (string) content.GetValueForProperty("GatewayType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayType, global::System.Convert.ToString); - } - if (content.Contains("GatewayEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayEndpoint = (string) content.GetValueForProperty("GatewayEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).GatewayEndpoint, global::System.Convert.ToString); - } - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 a Gateway Profile. - [System.ComponentModel.TypeConverter(typeof(GatewayPropertiesTypeConverter))] - public partial interface IGatewayProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.TypeConverter.cs deleted file mode 100644 index 0764571cdd91..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class GatewayPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return GatewayProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return GatewayProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return GatewayProperties.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.cs deleted file mode 100644 index 7c66014eece1..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the properties of a Gateway Profile. - public partial class GatewayProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal - { - - /// Backing field for property. - private System.Collections.Generic.List _allowedFeature; - - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List AllowedFeature { get => this._allowedFeature; set => this._allowedFeature = value; } - - /// Backing field for property. - private string _gatewayEndpoint; - - /// The endpoint fqdn for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string GatewayEndpoint { get => this._gatewayEndpoint; } - - /// Backing field for property. - private string _gatewayId; - - /// A unique, immutable, identifier for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string GatewayId { get => this._gatewayId; } - - /// Backing field for property. - private string _gatewayType; - - /// The type of the Gateway resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string GatewayType { get => this._gatewayType; set => this._gatewayType = value; } - - /// Internal Acessors for GatewayEndpoint - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal.GatewayEndpoint { get => this._gatewayEndpoint; set { {_gatewayEndpoint = value;} } } - - /// Internal Acessors for GatewayId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal.GatewayId { get => this._gatewayId; set { {_gatewayId = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Backing field for property. - private string _provisioningState; - - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ProvisioningState { get => this._provisioningState; } - - /// Creates an new instance. - public GatewayProperties() - { - - } - } - /// Describes the properties of a Gateway Profile. - public partial interface IGatewayProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the list of features that are enabled for this Gateway.", - SerializedName = @"allowedFeatures", - PossibleTypes = new [] { typeof(string) })] - System.Collections.Generic.List AllowedFeature { get; set; } - /// The endpoint fqdn for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The endpoint fqdn for the Gateway.", - SerializedName = @"gatewayEndpoint", - PossibleTypes = new [] { typeof(string) })] - string GatewayEndpoint { get; } - /// A unique, immutable, identifier for the Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"A unique, immutable, identifier for the Gateway.", - SerializedName = @"gatewayId", - PossibleTypes = new [] { typeof(string) })] - string GatewayId { get; } - /// The type of the Gateway resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The type of the Gateway resource.", - SerializedName = @"gatewayType", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Public")] - string GatewayType { get; set; } - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The provisioning state, which only appears in the response.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Creating", "Updating", "Deleting", "Succeeded", "Failed", "Accepted", "Canceled", "Deleted")] - string ProvisioningState { get; } - - } - /// Describes the properties of a Gateway Profile. - internal partial interface IGatewayPropertiesInternal - - { - /// Specifies the list of features that are enabled for this Gateway. - System.Collections.Generic.List AllowedFeature { get; set; } - /// The endpoint fqdn for the Gateway. - string GatewayEndpoint { get; set; } - /// A unique, immutable, identifier for the Gateway. - string GatewayId { get; set; } - /// The type of the Gateway resource. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Public")] - string GatewayType { get; set; } - /// The provisioning state, which only appears in the response. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Creating", "Updating", "Deleting", "Succeeded", "Failed", "Accepted", "Canceled", "Deleted")] - string ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.json.cs deleted file mode 100644 index 1d1973de220d..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayProperties.json.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the properties of a Gateway Profile. - public partial class GatewayProperties - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new GatewayProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal GatewayProperties(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} - {_gatewayId = If( json?.PropertyT("gatewayId"), out var __jsonGatewayId) ? (string)__jsonGatewayId : (string)_gatewayId;} - {_gatewayType = If( json?.PropertyT("gatewayType"), out var __jsonGatewayType) ? (string)__jsonGatewayType : (string)_gatewayType;} - {_gatewayEndpoint = If( json?.PropertyT("gatewayEndpoint"), out var __jsonGatewayEndpoint) ? (string)__jsonGatewayEndpoint : (string)_gatewayEndpoint;} - {_allowedFeature = If( json?.PropertyT("allowedFeatures"), out var __jsonAllowedFeatures) ? If( __jsonAllowedFeatures as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _allowedFeature;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._gatewayId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._gatewayId.ToString()) : null, "gatewayId" ,container.Add ); - } - AddIf( null != (((object)this._gatewayType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._gatewayType.ToString()) : null, "gatewayType" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._gatewayEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._gatewayEndpoint.ToString()) : null, "gatewayEndpoint" ,container.Add ); - } - if (null != this._allowedFeature) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.XNodeArray(); - foreach( var __x in this._allowedFeature ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("allowedFeatures",__w); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.PowerShell.cs deleted file mode 100644 index fbe85a0d030c..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.PowerShell.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes a License Update. - [System.ComponentModel.TypeConverter(typeof(GatewayUpdateTypeConverter))] - public partial class GatewayUpdate - { - - /// - /// 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.ConnectedMachine.Models.IGatewayUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new GatewayUpdate(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.ConnectedMachine.Models.IGatewayUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new GatewayUpdate(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.ConnectedMachine.Models.IGatewayUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal GatewayUpdate(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.ConnectedMachine.Models.IGatewayUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayUpdatePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdateTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal GatewayUpdate(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.ConnectedMachine.Models.IGatewayUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayUpdatePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdateTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 a License Update. - [System.ComponentModel.TypeConverter(typeof(GatewayUpdateTypeConverter))] - public partial interface IGatewayUpdate - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.TypeConverter.cs deleted file mode 100644 index 32e5ed7699f7..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class GatewayUpdateTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return GatewayUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return GatewayUpdate.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return GatewayUpdate.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.cs deleted file mode 100644 index eee8aad181e3..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes a License Update. - public partial class GatewayUpdate : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdate __resourceUpdate = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdate(); - - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List AllowedFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdatePropertiesInternal)Property).AllowedFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdatePropertiesInternal)Property).AllowedFeature = value ?? null /* arrayOf */; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayUpdateProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties _property; - - /// Gateway Update properties - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayUpdateProperties()); set => this._property = value; } - - /// Resource tags - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags Tags { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)__resourceUpdate).Tags; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)__resourceUpdate).Tags = value ?? null /* model class */; } - - /// Creates an new instance. - public GatewayUpdate() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resourceUpdate), __resourceUpdate); - await eventListener.AssertObjectIsValid(nameof(__resourceUpdate), __resourceUpdate); - } - } - /// Describes a License Update. - public partial interface IGatewayUpdate : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdate - { - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the list of features that are enabled for this Gateway.", - SerializedName = @"allowedFeatures", - PossibleTypes = new [] { typeof(string) })] - System.Collections.Generic.List AllowedFeature { get; set; } - - } - /// Describes a License Update. - internal partial interface IGatewayUpdateInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal - { - /// Specifies the list of features that are enabled for this Gateway. - System.Collections.Generic.List AllowedFeature { get; set; } - /// Gateway Update properties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties Property { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.PowerShell.cs deleted file mode 100644 index 4d710410e827..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.PowerShell.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes the Update properties of a Gateway Profile. - [System.ComponentModel.TypeConverter(typeof(GatewayUpdatePropertiesTypeConverter))] - public partial class GatewayUpdateProperties - { - - /// - /// 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.ConnectedMachine.Models.IGatewayUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new GatewayUpdateProperties(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.ConnectedMachine.Models.IGatewayUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new GatewayUpdateProperties(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.ConnectedMachine.Models.IGatewayUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal GatewayUpdateProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdatePropertiesInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdatePropertiesInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal GatewayUpdateProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AllowedFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdatePropertiesInternal)this).AllowedFeature = (System.Collections.Generic.List) content.GetValueForProperty("AllowedFeature",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdatePropertiesInternal)this).AllowedFeature, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Update properties of a Gateway Profile. - [System.ComponentModel.TypeConverter(typeof(GatewayUpdatePropertiesTypeConverter))] - public partial interface IGatewayUpdateProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.TypeConverter.cs deleted file mode 100644 index e61c48696409..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class GatewayUpdatePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return GatewayUpdateProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return GatewayUpdateProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return GatewayUpdateProperties.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.cs deleted file mode 100644 index 6f345b616f37..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the Update properties of a Gateway Profile. - public partial class GatewayUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdatePropertiesInternal - { - - /// Backing field for property. - private System.Collections.Generic.List _allowedFeature; - - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List AllowedFeature { get => this._allowedFeature; set => this._allowedFeature = value; } - - /// Creates an new instance. - public GatewayUpdateProperties() - { - - } - } - /// Describes the Update properties of a Gateway Profile. - public partial interface IGatewayUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Specifies the list of features that are enabled for this Gateway. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the list of features that are enabled for this Gateway.", - SerializedName = @"allowedFeatures", - PossibleTypes = new [] { typeof(string) })] - System.Collections.Generic.List AllowedFeature { get; set; } - - } - /// Describes the Update properties of a Gateway Profile. - internal partial interface IGatewayUpdatePropertiesInternal - - { - /// Specifies the list of features that are enabled for this Gateway. - System.Collections.Generic.List AllowedFeature { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.json.cs deleted file mode 100644 index a8f807066c4a..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdateProperties.json.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the Update properties of a Gateway Profile. - public partial class GatewayUpdateProperties - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new GatewayUpdateProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal GatewayUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_allowedFeature = If( json?.PropertyT("allowedFeatures"), out var __jsonAllowedFeatures) ? If( __jsonAllowedFeatures as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _allowedFeature;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (null != this._allowedFeature) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.XNodeArray(); - foreach( var __x in this._allowedFeature ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("allowedFeatures",__w); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.PowerShell.cs deleted file mode 100644 index 88eac52d5ef8..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.PowerShell.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// The List license operation response. - [System.ComponentModel.TypeConverter(typeof(GatewaysListResultTypeConverter))] - public partial class GatewaysListResult - { - - /// - /// 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.ConnectedMachine.Models.IGatewaysListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new GatewaysListResult(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.ConnectedMachine.Models.IGatewaysListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new GatewaysListResult(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.ConnectedMachine.Models.IGatewaysListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal GatewaysListResult(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.ConnectedMachine.Models.IGatewaysListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResultInternal)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 GatewaysListResult(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.ConnectedMachine.Models.IGatewaysListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResultInternal)this).NextLink, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 List license operation response. - [System.ComponentModel.TypeConverter(typeof(GatewaysListResultTypeConverter))] - public partial interface IGatewaysListResult - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.TypeConverter.cs deleted file mode 100644 index 8dd5b784178c..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class GatewaysListResultTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResult ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResult).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return GatewaysListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return GatewaysListResult.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return GatewaysListResult.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.cs deleted file mode 100644 index 20210a999d9b..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// The List license operation response. - public partial class GatewaysListResult : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResult, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResultInternal - { - - /// Backing field for property. - private string _nextLink; - - /// - /// The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private System.Collections.Generic.List _value; - - /// The list of Gateways. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public GatewaysListResult() - { - - } - } - /// The List license operation response. - public partial interface IGatewaysListResult : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// - /// The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of Gateways. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The list of Gateways.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway) })] - System.Collections.Generic.List Value { get; set; } - - } - /// The List license operation response. - internal partial interface IGatewaysListResultInternal - - { - /// - /// The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. - /// - string NextLink { get; set; } - /// The list of Gateways. - System.Collections.Generic.List Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.json.cs deleted file mode 100644 index ab7ab59c4c00..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewaysListResult.json.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// The List license operation response. - public partial class GatewaysListResult - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResult. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResult. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewaysListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new GatewaysListResult(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal GatewaysListResult(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGateway) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Gateway.FromJson(__u) )) ))() : null : _value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.PowerShell.cs deleted file mode 100644 index 1e8a97d0b8cd..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.PowerShell.cs +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Defines the HybridIdentityMetadata. - [System.ComponentModel.TypeConverter(typeof(HybridIdentityMetadataTypeConverter))] - public partial class HybridIdentityMetadata - { - - /// - /// 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.ConnectedMachine.Models.IHybridIdentityMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new HybridIdentityMetadata(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.ConnectedMachine.Models.IHybridIdentityMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new HybridIdentityMetadata(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.ConnectedMachine.Models.IHybridIdentityMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal HybridIdentityMetadata(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.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IdentityTypeConverter.ConvertFrom); - } - if (content.Contains("VMId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).VMId = (string) content.GetValueForProperty("VMId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).VMId, global::System.Convert.ToString); - } - if (content.Contains("PublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).PublicKey, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityType, 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 HybridIdentityMetadata(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.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IdentityTypeConverter.ConvertFrom); - } - if (content.Contains("VMId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).VMId = (string) content.GetValueForProperty("VMId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).VMId, global::System.Convert.ToString); - } - if (content.Contains("PublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).PublicKey, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal)this).IdentityType, 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.ConnectedMachine.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(); - } - } - /// Defines the HybridIdentityMetadata. - [System.ComponentModel.TypeConverter(typeof(HybridIdentityMetadataTypeConverter))] - public partial interface IHybridIdentityMetadata - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.TypeConverter.cs deleted file mode 100644 index 8576e51fd3ec..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class HybridIdentityMetadataTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return HybridIdentityMetadata.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return HybridIdentityMetadata.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return HybridIdentityMetadata.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.cs deleted file mode 100644 index 8d5577d0819c..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Defines the HybridIdentityMetadata. - public partial class HybridIdentityMetadata : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGenerated __proxyResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ProxyResourceAutoGenerated(); - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id; } - - /// The principal ID of resource identity. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityPrincipalId; } - - /// The tenant ID of resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityTenantId; } - - /// The identity type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityType = value ?? null; } - - /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal.Identity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).Identity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).Identity = value; } - - /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityPrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityPrincipalId = value; } - - /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).IdentityTenantId = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataProperties()); set { {_property = value;} } } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties _property; - - /// Resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataProperties()); set => this._property = value; } - - /// The Public Key. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string PublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).PublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).PublicKey = value ?? null; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedByType = value ?? null; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedByType = value ?? null; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type; } - - /// The unique identifier for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string VMId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).VMId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)Property).VMId = value ?? null; } - - /// Creates an new instance. - public HybridIdentityMetadata() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__proxyResourceAutoGenerated), __proxyResourceAutoGenerated); - await eventListener.AssertObjectIsValid(nameof(__proxyResourceAutoGenerated), __proxyResourceAutoGenerated); - } - } - /// Defines the HybridIdentityMetadata. - public partial interface IHybridIdentityMetadata : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGenerated - { - /// The principal ID of resource identity. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The principal ID of resource identity.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string IdentityPrincipalId { get; } - /// The tenant ID of resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The tenant ID of resource.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string IdentityTenantId { get; } - /// The identity type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The identity type.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("SystemAssigned")] - string IdentityType { get; } - /// The Public Key. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The Public Key.", - SerializedName = @"publicKey", - PossibleTypes = new [] { typeof(string) })] - string PublicKey { get; set; } - /// The unique identifier for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The unique identifier for the resource.", - SerializedName = @"vmId", - PossibleTypes = new [] { typeof(string) })] - string VMId { get; set; } - - } - /// Defines the HybridIdentityMetadata. - internal partial interface IHybridIdentityMetadataInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGeneratedInternal - { - /// Identity for the resource. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity Identity { get; set; } - /// The principal ID of resource identity. - string IdentityPrincipalId { get; set; } - /// The tenant ID of resource. - string IdentityTenantId { get; set; } - /// The identity type. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("SystemAssigned")] - string IdentityType { get; set; } - /// Resource properties. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties Property { get; set; } - /// The Public Key. - string PublicKey { get; set; } - /// The unique identifier for the resource. - string VMId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.json.cs deleted file mode 100644 index b8e08d1e0e4e..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadata.json.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Defines the HybridIdentityMetadata. - public partial class HybridIdentityMetadata - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new HybridIdentityMetadata(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal HybridIdentityMetadata(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __proxyResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ProxyResourceAutoGenerated(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataProperties.FromJson(__jsonProperties) : _property;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __proxyResourceAutoGenerated?.ToJson(container, serializationMode); - AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.PowerShell.cs deleted file mode 100644 index ce6b83b408d7..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.PowerShell.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// List of HybridIdentityMetadata. - [System.ComponentModel.TypeConverter(typeof(HybridIdentityMetadataListTypeConverter))] - public partial class HybridIdentityMetadataList - { - - /// - /// 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.ConnectedMachine.Models.IHybridIdentityMetadataList DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new HybridIdentityMetadataList(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.ConnectedMachine.Models.IHybridIdentityMetadataList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new HybridIdentityMetadataList(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.ConnectedMachine.Models.IHybridIdentityMetadataList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal HybridIdentityMetadataList(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).NextLink, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal HybridIdentityMetadataList(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).NextLink, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadataTypeConverter.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.ConnectedMachine.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 HybridIdentityMetadata. - [System.ComponentModel.TypeConverter(typeof(HybridIdentityMetadataListTypeConverter))] - public partial interface IHybridIdentityMetadataList - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.TypeConverter.cs deleted file mode 100644 index 6c6f468e391c..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class HybridIdentityMetadataListTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataList ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataList).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return HybridIdentityMetadataList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return HybridIdentityMetadataList.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return HybridIdentityMetadataList.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.cs deleted file mode 100644 index 28d6ec9b4508..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// List of HybridIdentityMetadata. - public partial class HybridIdentityMetadataList : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataList, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// Url to follow for getting next page of HybridIdentityMetadata. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private System.Collections.Generic.List _value; - - /// Array of HybridIdentityMetadata - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public HybridIdentityMetadataList() - { - - } - } - /// List of HybridIdentityMetadata. - public partial interface IHybridIdentityMetadataList : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Url to follow for getting next page of HybridIdentityMetadata. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Url to follow for getting next page of HybridIdentityMetadata.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// Array of HybridIdentityMetadata - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Array of HybridIdentityMetadata", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata) })] - System.Collections.Generic.List Value { get; set; } - - } - /// List of HybridIdentityMetadata. - internal partial interface IHybridIdentityMetadataListInternal - - { - /// Url to follow for getting next page of HybridIdentityMetadata. - string NextLink { get; set; } - /// Array of HybridIdentityMetadata - System.Collections.Generic.List Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.json.cs deleted file mode 100644 index eebc25cda6d4..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataList.json.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// List of HybridIdentityMetadata. - public partial class HybridIdentityMetadataList - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataList. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataList. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new HybridIdentityMetadataList(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal HybridIdentityMetadataList(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadata) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.HybridIdentityMetadata.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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - if (null != this._value) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.PowerShell.cs deleted file mode 100644 index b1e5a536641e..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.PowerShell.cs +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Defines the resource properties. - [System.ComponentModel.TypeConverter(typeof(HybridIdentityMetadataPropertiesTypeConverter))] - public partial class HybridIdentityMetadataProperties - { - - /// - /// 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.ConnectedMachine.Models.IHybridIdentityMetadataProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new HybridIdentityMetadataProperties(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.ConnectedMachine.Models.IHybridIdentityMetadataProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new HybridIdentityMetadataProperties(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.ConnectedMachine.Models.IHybridIdentityMetadataProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal HybridIdentityMetadataProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IdentityTypeConverter.ConvertFrom); - } - if (content.Contains("VMId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).VMId = (string) content.GetValueForProperty("VMId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).VMId, global::System.Convert.ToString); - } - if (content.Contains("PublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).PublicKey, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityType, 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 HybridIdentityMetadataProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IdentityTypeConverter.ConvertFrom); - } - if (content.Contains("VMId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).VMId = (string) content.GetValueForProperty("VMId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).VMId, global::System.Convert.ToString); - } - if (content.Contains("PublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).PublicKey = (string) content.GetValueForProperty("PublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).PublicKey, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal)this).IdentityType, 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.ConnectedMachine.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(); - } - } - /// Defines the resource properties. - [System.ComponentModel.TypeConverter(typeof(HybridIdentityMetadataPropertiesTypeConverter))] - public partial interface IHybridIdentityMetadataProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.cs deleted file mode 100644 index fbffe34d956b..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Defines the resource properties. - public partial class HybridIdentityMetadataProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity _identity; - - /// Identity for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Identity()); } - - /// The principal ID of resource identity. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).PrincipalId; } - - /// The tenant ID of resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).TenantId; } - - /// The identity type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).Type = value ?? null; } - - /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Identity()); set { {_identity = value;} } } - - /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).PrincipalId = value; } - - /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataPropertiesInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentityInternal)Identity).TenantId = value; } - - /// Backing field for property. - private string _publicKey; - - /// The Public Key. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string PublicKey { get => this._publicKey; set => this._publicKey = value; } - - /// Backing field for property. - private string _vMId; - - /// The unique identifier for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string VMId { get => this._vMId; set => this._vMId = value; } - - /// Creates an new instance. - public HybridIdentityMetadataProperties() - { - - } - } - /// Defines the resource properties. - public partial interface IHybridIdentityMetadataProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// The principal ID of resource identity. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The principal ID of resource identity.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string IdentityPrincipalId { get; } - /// The tenant ID of resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The tenant ID of resource.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string IdentityTenantId { get; } - /// The identity type. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The identity type.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("SystemAssigned")] - string IdentityType { get; } - /// The Public Key. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The Public Key.", - SerializedName = @"publicKey", - PossibleTypes = new [] { typeof(string) })] - string PublicKey { get; set; } - /// The unique identifier for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The unique identifier for the resource.", - SerializedName = @"vmId", - PossibleTypes = new [] { typeof(string) })] - string VMId { get; set; } - - } - /// Defines the resource properties. - internal partial interface IHybridIdentityMetadataPropertiesInternal - - { - /// Identity for the resource. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IIdentity Identity { get; set; } - /// The principal ID of resource identity. - string IdentityPrincipalId { get; set; } - /// The tenant ID of resource. - string IdentityTenantId { get; set; } - /// The identity type. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("SystemAssigned")] - string IdentityType { get; set; } - /// The Public Key. - string PublicKey { get; set; } - /// The unique identifier for the resource. - string VMId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.json.cs deleted file mode 100644 index 022f16df1e20..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.json.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Defines the resource properties. - public partial class HybridIdentityMetadataProperties - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new HybridIdentityMetadataProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal HybridIdentityMetadataProperties(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.Identity.FromJson(__jsonIdentity) : _identity;} - {_vMId = If( json?.PropertyT("vmId"), out var __jsonVMId) ? (string)__jsonVMId : (string)_vMId;} - {_publicKey = If( json?.PropertyT("publicKey"), out var __jsonPublicKey) ? (string)__jsonPublicKey : (string)_publicKey;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); - } - AddIf( null != (((object)this._vMId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._vMId.ToString()) : null, "vmId" ,container.Add ); - AddIf( null != (((object)this._publicKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._publicKey.ToString()) : null, "publicKey" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.PowerShell.cs deleted file mode 100644 index f74821c06099..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.PowerShell.cs +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes a Run Command - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandTypeConverter))] - public partial class MachineRunCommand - { - - /// - /// 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.ConnectedMachine.Models.IMachineRunCommand DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineRunCommand(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.ConnectedMachine.Models.IMachineRunCommand DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineRunCommand(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.ConnectedMachine.Models.IMachineRunCommand FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineRunCommand(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.ConnectedMachine.Models.IMachineRunCommandInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSourceTypeConverter.ConvertFrom); - } - if (content.Contains("OutputBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("OutputBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("ErrorBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("ErrorBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("InstanceView")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceView = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView) content.GetValueForProperty("InstanceView",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceView, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceViewTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("ProtectedParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProtectedParameter = (System.Collections.Generic.List) content.GetValueForProperty("ProtectedParameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProtectedParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("AsyncExecution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).AsyncExecution = (bool?) content.GetValueForProperty("AsyncExecution",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).AsyncExecution, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunAsUser")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsUser = (string) content.GetValueForProperty("RunAsUser",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsUser, global::System.Convert.ToString); - } - if (content.Contains("RunAsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsPassword = (string) content.GetValueForProperty("RunAsPassword",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsPassword, global::System.Convert.ToString); - } - if (content.Contains("TimeoutInSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).TimeoutInSecond = (int?) content.GetValueForProperty("TimeoutInSecond",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).TimeoutInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("OutputBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobUri = (string) content.GetValueForProperty("OutputBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobUri = (string) content.GetValueForProperty("ErrorBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionState = (string) content.GetValueForProperty("InstanceViewExecutionState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionState, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUriManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUriManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("SourceScriptUriManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUriManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("SourceScript")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScript = (string) content.GetValueForProperty("SourceScript",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScript, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUri = (string) content.GetValueForProperty("SourceScriptUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUri, global::System.Convert.ToString); - } - if (content.Contains("SourceCommandId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceCommandId = (string) content.GetValueForProperty("SourceCommandId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceCommandId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityClientId = (string) content.GetValueForProperty("OutputBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityObjectId = (string) content.GetValueForProperty("OutputBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityClientId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityObjectId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionMessage = (string) content.GetValueForProperty("InstanceViewExecutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionMessage, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExitCode = (int?) content.GetValueForProperty("InstanceViewExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("InstanceViewOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewOutput = (string) content.GetValueForProperty("InstanceViewOutput",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewOutput, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewError = (string) content.GetValueForProperty("InstanceViewError",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewError, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStartTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewEndTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewEndTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStatuses = (System.Collections.Generic.List) content.GetValueForProperty("InstanceViewStatuses",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionsResourceStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ScriptUriManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityClientId = (string) content.GetValueForProperty("ScriptUriManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityObjectId = (string) content.GetValueForProperty("ScriptUriManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityObjectId, 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 MachineRunCommand(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.ConnectedMachine.Models.IMachineRunCommandInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSourceTypeConverter.ConvertFrom); - } - if (content.Contains("OutputBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("OutputBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("ErrorBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("ErrorBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("InstanceView")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceView = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView) content.GetValueForProperty("InstanceView",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceView, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceViewTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("ProtectedParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProtectedParameter = (System.Collections.Generic.List) content.GetValueForProperty("ProtectedParameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProtectedParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("AsyncExecution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).AsyncExecution = (bool?) content.GetValueForProperty("AsyncExecution",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).AsyncExecution, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunAsUser")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsUser = (string) content.GetValueForProperty("RunAsUser",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsUser, global::System.Convert.ToString); - } - if (content.Contains("RunAsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsPassword = (string) content.GetValueForProperty("RunAsPassword",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).RunAsPassword, global::System.Convert.ToString); - } - if (content.Contains("TimeoutInSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).TimeoutInSecond = (int?) content.GetValueForProperty("TimeoutInSecond",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).TimeoutInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("OutputBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobUri = (string) content.GetValueForProperty("OutputBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobUri = (string) content.GetValueForProperty("ErrorBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionState = (string) content.GetValueForProperty("InstanceViewExecutionState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionState, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUriManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUriManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("SourceScriptUriManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUriManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("SourceScript")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScript = (string) content.GetValueForProperty("SourceScript",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScript, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUri = (string) content.GetValueForProperty("SourceScriptUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceScriptUri, global::System.Convert.ToString); - } - if (content.Contains("SourceCommandId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceCommandId = (string) content.GetValueForProperty("SourceCommandId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).SourceCommandId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityClientId = (string) content.GetValueForProperty("OutputBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityObjectId = (string) content.GetValueForProperty("OutputBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).OutputBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityClientId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityObjectId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ErrorBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionMessage = (string) content.GetValueForProperty("InstanceViewExecutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExecutionMessage, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExitCode = (int?) content.GetValueForProperty("InstanceViewExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("InstanceViewOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewOutput = (string) content.GetValueForProperty("InstanceViewOutput",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewOutput, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewError = (string) content.GetValueForProperty("InstanceViewError",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewError, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStartTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewEndTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewEndTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStatuses = (System.Collections.Generic.List) content.GetValueForProperty("InstanceViewStatuses",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).InstanceViewStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionsResourceStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ScriptUriManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityClientId = (string) content.GetValueForProperty("ScriptUriManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityObjectId = (string) content.GetValueForProperty("ScriptUriManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal)this).ScriptUriManagedIdentityObjectId, 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.ConnectedMachine.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 a Run Command - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandTypeConverter))] - public partial interface IMachineRunCommand - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.TypeConverter.cs deleted file mode 100644 index 91948798c95c..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class MachineRunCommandTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return MachineRunCommand.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return MachineRunCommand.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return MachineRunCommand.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.cs deleted file mode 100644 index 7c365fd30109..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.cs +++ /dev/null @@ -1,694 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes a Run Command - public partial class MachineRunCommand : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResource(); - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public bool? AsyncExecution { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).AsyncExecution; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).AsyncExecution = value ?? default(bool); } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ErrorBlobManagedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobManagedIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobManagedIdentityClientId = value ?? null; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ErrorBlobManagedIdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobManagedIdentityObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobManagedIdentityObjectId = value ?? null; } - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ErrorBlobUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobUri = value ?? null; } - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Id; } - - /// Script end time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? InstanceViewEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewEndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewEndTime = value ?? default(global::System.DateTime); } - - /// Script error stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewError { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewError; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewError = value ?? null; } - - /// Communicate script configuration errors or execution messages. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewExecutionMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewExecutionMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewExecutionMessage = value ?? null; } - - /// Script execution status. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewExecutionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewExecutionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewExecutionState = value ?? null; } - - /// Exit code returned from script execution. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public int? InstanceViewExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewExitCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewExitCode = value ?? default(int); } - - /// Script output stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewOutput { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewOutput; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewOutput = value ?? null; } - - /// Script start time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? InstanceViewStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewStartTime = value ?? default(global::System.DateTime); } - - /// The status information. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List InstanceViewStatuses { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewStatuses; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceViewStatuses = value ?? null /* arrayOf */; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for ErrorBlobManagedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal.ErrorBlobManagedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobManagedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ErrorBlobManagedIdentity = value; } - - /// Internal Acessors for InstanceView - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal.InstanceView { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceView; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).InstanceView = value; } - - /// Internal Acessors for OutputBlobManagedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal.OutputBlobManagedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobManagedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobManagedIdentity = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Source - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal.Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).Source = value; } - - /// Internal Acessors for SourceScriptUriManagedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInternal.SourceScriptUriManagedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceScriptUriManagedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceScriptUriManagedIdentity = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Name; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string OutputBlobManagedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobManagedIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobManagedIdentityClientId = value ?? null; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string OutputBlobManagedIdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobManagedIdentityObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobManagedIdentityObjectId = value ?? null; } - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string OutputBlobUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).OutputBlobUri = value ?? null; } - - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties _property; - - /// Describes Run Command Properties - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandProperties()); set => this._property = value; } - - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List ProtectedParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ProtectedParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ProtectedParameter = value ?? null /* arrayOf */; } - - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); } - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string RunAsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).RunAsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).RunAsPassword = value ?? null; } - - /// Specifies the user account on the machine when executing the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string RunAsUser { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).RunAsUser; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).RunAsUser = value ?? null; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScriptUriManagedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ScriptUriManagedIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ScriptUriManagedIdentityClientId = value ?? null; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScriptUriManagedIdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ScriptUriManagedIdentityObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).ScriptUriManagedIdentityObjectId = value ?? null; } - - /// Specifies the commandId of predefined built-in script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string SourceCommandId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceCommandId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceCommandId = value ?? null; } - - /// Specifies the script content to be executed on the machine. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string SourceScript { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceScript; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceScript = value ?? null; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string SourceScriptUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceScriptUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).SourceScriptUri = value ?? null; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tags { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)__trackedResource).Tags; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal)__trackedResource).Tags = value ?? null /* model class */; } - - /// The timeout in seconds to execute the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public int? TimeoutInSecond { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).TimeoutInSecond; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)Property).TimeoutInSecond = value ?? default(int); } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__trackedResource).Type; } - - /// Creates an new instance. - public MachineRunCommand() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// Describes a Run Command - public partial interface IMachineRunCommand : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResource - { - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(bool) })] - bool? AsyncExecution { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ErrorBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string ErrorBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - string ErrorBlobUri { get; set; } - /// Script end time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script end time.", - SerializedName = @"endTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? InstanceViewEndTime { get; } - /// Script error stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script error stream.", - SerializedName = @"error", - PossibleTypes = new [] { typeof(string) })] - string InstanceViewError { get; } - /// Communicate script configuration errors or execution messages. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Communicate script configuration errors or execution messages.", - SerializedName = @"executionMessage", - PossibleTypes = new [] { typeof(string) })] - string InstanceViewExecutionMessage { get; } - /// Script execution status. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script execution status.", - SerializedName = @"executionState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Unknown", "Pending", "Running", "Failed", "Succeeded", "TimedOut", "Canceled")] - string InstanceViewExecutionState { get; } - /// Exit code returned from script execution. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Exit code returned from script execution.", - SerializedName = @"exitCode", - PossibleTypes = new [] { typeof(int) })] - int? InstanceViewExitCode { get; } - /// Script output stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script output stream.", - SerializedName = @"output", - PossibleTypes = new [] { typeof(string) })] - string InstanceViewOutput { get; } - /// Script start time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script start time.", - SerializedName = @"startTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? InstanceViewStartTime { get; } - /// The status information. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The status information.", - SerializedName = @"statuses", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionsResourceStatus) })] - System.Collections.Generic.List InstanceViewStatuses { get; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string OutputBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string OutputBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - string OutputBlobUri { get; set; } - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - System.Collections.Generic.List Parameter { get; set; } - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - System.Collections.Generic.List ProtectedParameter { get; set; } - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The provisioning state, which only appears in the response.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - string ProvisioningState { get; } - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - string RunAsPassword { get; set; } - /// Specifies the user account on the machine when executing the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - string RunAsUser { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ScriptUriManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string ScriptUriManagedIdentityObjectId { get; set; } - /// Specifies the commandId of predefined built-in script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - string SourceCommandId { get; set; } - /// Specifies the script content to be executed on the machine. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - string SourceScript { get; set; } - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - string SourceScriptUri { get; set; } - /// The timeout in seconds to execute the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - int? TimeoutInSecond { get; set; } - - } - /// Describes a Run Command - internal partial interface IMachineRunCommandInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceInternal - { - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - bool? AsyncExecution { get; set; } - /// - /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned - /// identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role - /// assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - /// - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity ErrorBlobManagedIdentity { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string ErrorBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string ErrorBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - string ErrorBlobUri { get; set; } - /// The machine run command instance view. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView InstanceView { get; set; } - /// Script end time. - global::System.DateTime? InstanceViewEndTime { get; set; } - /// Script error stream. - string InstanceViewError { get; set; } - /// Communicate script configuration errors or execution messages. - string InstanceViewExecutionMessage { get; set; } - /// Script execution status. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Unknown", "Pending", "Running", "Failed", "Succeeded", "TimedOut", "Canceled")] - string InstanceViewExecutionState { get; set; } - /// Exit code returned from script execution. - int? InstanceViewExitCode { get; set; } - /// Script output stream. - string InstanceViewOutput { get; set; } - /// Script start time. - global::System.DateTime? InstanceViewStartTime { get; set; } - /// The status information. - System.Collections.Generic.List InstanceViewStatuses { get; set; } - /// - /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned - /// identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role - /// assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - /// - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity OutputBlobManagedIdentity { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string OutputBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string OutputBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - string OutputBlobUri { get; set; } - /// The parameters used by the script. - System.Collections.Generic.List Parameter { get; set; } - /// Describes Run Command Properties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties Property { get; set; } - /// The parameters used by the script. - System.Collections.Generic.List ProtectedParameter { get; set; } - /// The provisioning state, which only appears in the response. - string ProvisioningState { get; set; } - /// - /// Specifies the user account password on the machine when executing the run command. - /// - string RunAsPassword { get; set; } - /// Specifies the user account on the machine when executing the run command. - string RunAsUser { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string ScriptUriManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string ScriptUriManagedIdentityObjectId { get; set; } - /// The source of the run command script. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource Source { get; set; } - /// Specifies the commandId of predefined built-in script. - string SourceCommandId { get; set; } - /// Specifies the script content to be executed on the machine. - string SourceScript { get; set; } - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - string SourceScriptUri { get; set; } - /// - /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case - /// of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's - /// container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under - /// VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity SourceScriptUriManagedIdentity { get; set; } - /// The timeout in seconds to execute the run command. - int? TimeoutInSecond { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.json.cs deleted file mode 100644 index 471fab96b3b3..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommand.json.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes a Run Command - public partial class MachineRunCommand - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new MachineRunCommand(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal MachineRunCommand(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandProperties.FromJson(__jsonProperties) : _property;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.PowerShell.cs deleted file mode 100644 index b57766287bdd..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.PowerShell.cs +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// The instance view of a machine run command. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandInstanceViewTypeConverter))] - public partial class MachineRunCommandInstanceView - { - - /// - /// 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.ConnectedMachine.Models.IMachineRunCommandInstanceView DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineRunCommandInstanceView(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.ConnectedMachine.Models.IMachineRunCommandInstanceView DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineRunCommandInstanceView(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.ConnectedMachine.Models.IMachineRunCommandInstanceView FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineRunCommandInstanceView(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExecutionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionState = (string) content.GetValueForProperty("ExecutionState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionState, global::System.Convert.ToString); - } - if (content.Contains("ExecutionMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionMessage = (string) content.GetValueForProperty("ExecutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionMessage, global::System.Convert.ToString); - } - if (content.Contains("ExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExitCode = (int?) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Output")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Output = (string) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Output, global::System.Convert.ToString); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Error = (string) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Error, global::System.Convert.ToString); - } - if (content.Contains("StartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Statuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Statuses = (System.Collections.Generic.List) content.GetValueForProperty("Statuses",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Statuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionsResourceStatusTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MachineRunCommandInstanceView(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExecutionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionState = (string) content.GetValueForProperty("ExecutionState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionState, global::System.Convert.ToString); - } - if (content.Contains("ExecutionMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionMessage = (string) content.GetValueForProperty("ExecutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExecutionMessage, global::System.Convert.ToString); - } - if (content.Contains("ExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExitCode = (int?) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).ExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Output")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Output = (string) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Output, global::System.Convert.ToString); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Error = (string) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Error, global::System.Convert.ToString); - } - if (content.Contains("StartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("EndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).EndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Statuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Statuses = (System.Collections.Generic.List) content.GetValueForProperty("Statuses",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)this).Statuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionsResourceStatusTypeConverter.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.ConnectedMachine.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 instance view of a machine run command. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandInstanceViewTypeConverter))] - public partial interface IMachineRunCommandInstanceView - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.TypeConverter.cs deleted file mode 100644 index b27227497043..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class MachineRunCommandInstanceViewTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return MachineRunCommandInstanceView.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return MachineRunCommandInstanceView.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return MachineRunCommandInstanceView.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.cs deleted file mode 100644 index a5ae5348fd77..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// The instance view of a machine run command. - public partial class MachineRunCommandInstanceView : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal - { - - /// Backing field for property. - private global::System.DateTime? _endTime; - - /// Script end time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public global::System.DateTime? EndTime { get => this._endTime; set => this._endTime = value; } - - /// Backing field for property. - private string _error; - - /// Script error stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Error { get => this._error; set => this._error = value; } - - /// Backing field for property. - private string _executionMessage; - - /// Communicate script configuration errors or execution messages. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ExecutionMessage { get => this._executionMessage; set => this._executionMessage = value; } - - /// Backing field for property. - private string _executionState; - - /// Script execution status. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ExecutionState { get => this._executionState; set => this._executionState = value; } - - /// Backing field for property. - private int? _exitCode; - - /// Exit code returned from script execution. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public int? ExitCode { get => this._exitCode; set => this._exitCode = value; } - - /// Backing field for property. - private string _output; - - /// Script output stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Output { get => this._output; set => this._output = value; } - - /// Backing field for property. - private global::System.DateTime? _startTime; - - /// Script start time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } - - /// Backing field for property. - private System.Collections.Generic.List _statuses; - - /// The status information. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List Statuses { get => this._statuses; set => this._statuses = value; } - - /// Creates an new instance. - public MachineRunCommandInstanceView() - { - - } - } - /// The instance view of a machine run command. - public partial interface IMachineRunCommandInstanceView : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Script end time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Script end time.", - SerializedName = @"endTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? EndTime { get; set; } - /// Script error stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Script error stream.", - SerializedName = @"error", - PossibleTypes = new [] { typeof(string) })] - string Error { get; set; } - /// Communicate script configuration errors or execution messages. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Communicate script configuration errors or execution messages.", - SerializedName = @"executionMessage", - PossibleTypes = new [] { typeof(string) })] - string ExecutionMessage { get; set; } - /// Script execution status. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Script execution status.", - SerializedName = @"executionState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Unknown", "Pending", "Running", "Failed", "Succeeded", "TimedOut", "Canceled")] - string ExecutionState { get; set; } - /// Exit code returned from script execution. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Exit code returned from script execution.", - SerializedName = @"exitCode", - PossibleTypes = new [] { typeof(int) })] - int? ExitCode { get; set; } - /// Script output stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Script output stream.", - SerializedName = @"output", - PossibleTypes = new [] { typeof(string) })] - string Output { get; set; } - /// Script start time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Script start time.", - SerializedName = @"startTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? StartTime { get; set; } - /// The status information. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The status information.", - SerializedName = @"statuses", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionsResourceStatus) })] - System.Collections.Generic.List Statuses { get; set; } - - } - /// The instance view of a machine run command. - internal partial interface IMachineRunCommandInstanceViewInternal - - { - /// Script end time. - global::System.DateTime? EndTime { get; set; } - /// Script error stream. - string Error { get; set; } - /// Communicate script configuration errors or execution messages. - string ExecutionMessage { get; set; } - /// Script execution status. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Unknown", "Pending", "Running", "Failed", "Succeeded", "TimedOut", "Canceled")] - string ExecutionState { get; set; } - /// Exit code returned from script execution. - int? ExitCode { get; set; } - /// Script output stream. - string Output { get; set; } - /// Script start time. - global::System.DateTime? StartTime { get; set; } - /// The status information. - System.Collections.Generic.List Statuses { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.json.cs deleted file mode 100644 index 06ccdaacc366..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandInstanceView.json.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// The instance view of a machine run command. - public partial class MachineRunCommandInstanceView - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new MachineRunCommandInstanceView(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal MachineRunCommandInstanceView(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_executionState = If( json?.PropertyT("executionState"), out var __jsonExecutionState) ? (string)__jsonExecutionState : (string)_executionState;} - {_executionMessage = If( json?.PropertyT("executionMessage"), out var __jsonExecutionMessage) ? (string)__jsonExecutionMessage : (string)_executionMessage;} - {_exitCode = If( json?.PropertyT("exitCode"), out var __jsonExitCode) ? (int?)__jsonExitCode : _exitCode;} - {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? (string)__jsonOutput : (string)_output;} - {_error = If( json?.PropertyT("error"), out var __jsonError) ? (string)__jsonError : (string)_error;} - {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : _startTime : _startTime;} - {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : _endTime : _endTime;} - {_statuses = If( json?.PropertyT("statuses"), out var __jsonStatuses) ? If( __jsonStatuses as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionsResourceStatus) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionsResourceStatus.FromJson(__u) )) ))() : null : _statuses;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._executionState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._executionState.ToString()) : null, "executionState" ,container.Add ); - AddIf( null != (((object)this._executionMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._executionMessage.ToString()) : null, "executionMessage" ,container.Add ); - AddIf( null != this._exitCode ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNumber((int)this._exitCode) : null, "exitCode" ,container.Add ); - AddIf( null != (((object)this._output)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._output.ToString()) : null, "output" ,container.Add ); - AddIf( null != (((object)this._error)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._error.ToString()) : null, "error" ,container.Add ); - AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); - AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); - if (null != this._statuses) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.XNodeArray(); - foreach( var __x in this._statuses ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("statuses",__w); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.PowerShell.cs deleted file mode 100644 index 70f246a9edad..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.PowerShell.cs +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes the properties of a run command. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandPropertiesTypeConverter))] - public partial class MachineRunCommandProperties - { - - /// - /// 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.ConnectedMachine.Models.IMachineRunCommandProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineRunCommandProperties(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.ConnectedMachine.Models.IMachineRunCommandProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineRunCommandProperties(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.ConnectedMachine.Models.IMachineRunCommandProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineRunCommandProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSourceTypeConverter.ConvertFrom); - } - if (content.Contains("OutputBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("OutputBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("ErrorBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("ErrorBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("InstanceView")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceView = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView) content.GetValueForProperty("InstanceView",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceView, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceViewTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("ProtectedParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProtectedParameter = (System.Collections.Generic.List) content.GetValueForProperty("ProtectedParameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProtectedParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("AsyncExecution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).AsyncExecution = (bool?) content.GetValueForProperty("AsyncExecution",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).AsyncExecution, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunAsUser")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsUser = (string) content.GetValueForProperty("RunAsUser",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsUser, global::System.Convert.ToString); - } - if (content.Contains("RunAsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsPassword = (string) content.GetValueForProperty("RunAsPassword",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsPassword, global::System.Convert.ToString); - } - if (content.Contains("TimeoutInSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).TimeoutInSecond = (int?) content.GetValueForProperty("TimeoutInSecond",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).TimeoutInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("OutputBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobUri = (string) content.GetValueForProperty("OutputBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobUri = (string) content.GetValueForProperty("ErrorBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionState = (string) content.GetValueForProperty("InstanceViewExecutionState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionState, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUriManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUriManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("SourceScriptUriManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUriManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("SourceScript")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScript = (string) content.GetValueForProperty("SourceScript",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScript, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUri = (string) content.GetValueForProperty("SourceScriptUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUri, global::System.Convert.ToString); - } - if (content.Contains("SourceCommandId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceCommandId = (string) content.GetValueForProperty("SourceCommandId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceCommandId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityClientId = (string) content.GetValueForProperty("OutputBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityObjectId = (string) content.GetValueForProperty("OutputBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityClientId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityObjectId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionMessage = (string) content.GetValueForProperty("InstanceViewExecutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionMessage, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExitCode = (int?) content.GetValueForProperty("InstanceViewExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("InstanceViewOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewOutput = (string) content.GetValueForProperty("InstanceViewOutput",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewOutput, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewError = (string) content.GetValueForProperty("InstanceViewError",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewError, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStartTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewEndTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewEndTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStatuses = (System.Collections.Generic.List) content.GetValueForProperty("InstanceViewStatuses",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionsResourceStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ScriptUriManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityClientId = (string) content.GetValueForProperty("ScriptUriManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityObjectId = (string) content.GetValueForProperty("ScriptUriManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityObjectId, 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 MachineRunCommandProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Source")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSourceTypeConverter.ConvertFrom); - } - if (content.Contains("OutputBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("OutputBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("ErrorBlobManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("ErrorBlobManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("InstanceView")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceView = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView) content.GetValueForProperty("InstanceView",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceView, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceViewTypeConverter.ConvertFrom); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("ProtectedParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProtectedParameter = (System.Collections.Generic.List) content.GetValueForProperty("ProtectedParameter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProtectedParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("AsyncExecution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).AsyncExecution = (bool?) content.GetValueForProperty("AsyncExecution",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).AsyncExecution, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RunAsUser")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsUser = (string) content.GetValueForProperty("RunAsUser",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsUser, global::System.Convert.ToString); - } - if (content.Contains("RunAsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsPassword = (string) content.GetValueForProperty("RunAsPassword",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).RunAsPassword, global::System.Convert.ToString); - } - if (content.Contains("TimeoutInSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).TimeoutInSecond = (int?) content.GetValueForProperty("TimeoutInSecond",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).TimeoutInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("OutputBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobUri = (string) content.GetValueForProperty("OutputBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobUri = (string) content.GetValueForProperty("ErrorBlobUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobUri, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionState = (string) content.GetValueForProperty("InstanceViewExecutionState",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionState, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUriManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUriManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("SourceScriptUriManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUriManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("SourceScript")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScript = (string) content.GetValueForProperty("SourceScript",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScript, global::System.Convert.ToString); - } - if (content.Contains("SourceScriptUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUri = (string) content.GetValueForProperty("SourceScriptUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceScriptUri, global::System.Convert.ToString); - } - if (content.Contains("SourceCommandId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceCommandId = (string) content.GetValueForProperty("SourceCommandId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).SourceCommandId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityClientId = (string) content.GetValueForProperty("OutputBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("OutputBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityObjectId = (string) content.GetValueForProperty("OutputBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).OutputBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityClientId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ErrorBlobManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityObjectId = (string) content.GetValueForProperty("ErrorBlobManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ErrorBlobManagedIdentityObjectId, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExecutionMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionMessage = (string) content.GetValueForProperty("InstanceViewExecutionMessage",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExecutionMessage, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExitCode = (int?) content.GetValueForProperty("InstanceViewExitCode",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewExitCode, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("InstanceViewOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewOutput = (string) content.GetValueForProperty("InstanceViewOutput",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewOutput, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewError = (string) content.GetValueForProperty("InstanceViewError",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewError, global::System.Convert.ToString); - } - if (content.Contains("InstanceViewStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStartTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewStartTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewEndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewEndTime = (global::System.DateTime?) content.GetValueForProperty("InstanceViewEndTime",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewEndTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("InstanceViewStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStatuses = (System.Collections.Generic.List) content.GetValueForProperty("InstanceViewStatuses",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).InstanceViewStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ExtensionsResourceStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ScriptUriManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityClientId = (string) content.GetValueForProperty("ScriptUriManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityObjectId = (string) content.GetValueForProperty("ScriptUriManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal)this).ScriptUriManagedIdentityObjectId, 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.ConnectedMachine.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 a run command. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandPropertiesTypeConverter))] - public partial interface IMachineRunCommandProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.TypeConverter.cs deleted file mode 100644 index 878efd932653..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class MachineRunCommandPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return MachineRunCommandProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return MachineRunCommandProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return MachineRunCommandProperties.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.cs deleted file mode 100644 index 7d8b6c03f54b..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.cs +++ /dev/null @@ -1,658 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the properties of a run command. - public partial class MachineRunCommandProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal - { - - /// Backing field for property. - private bool? _asyncExecution; - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public bool? AsyncExecution { get => this._asyncExecution; set => this._asyncExecution = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity _errorBlobManagedIdentity; - - /// - /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned - /// identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role - /// assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity ErrorBlobManagedIdentity { get => (this._errorBlobManagedIdentity = this._errorBlobManagedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity()); set => this._errorBlobManagedIdentity = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ErrorBlobManagedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ErrorBlobManagedIdentity).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ErrorBlobManagedIdentity).ClientId = value ?? null; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ErrorBlobManagedIdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ErrorBlobManagedIdentity).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ErrorBlobManagedIdentity).ObjectId = value ?? null; } - - /// Backing field for property. - private string _errorBlobUri; - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ErrorBlobUri { get => this._errorBlobUri; set => this._errorBlobUri = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView _instanceView; - - /// The machine run command instance view. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView InstanceView { get => (this._instanceView = this._instanceView ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceView()); } - - /// Script end time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? InstanceViewEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).EndTime = value ?? default(global::System.DateTime); } - - /// Script error stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewError { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).Error = value ?? null; } - - /// Communicate script configuration errors or execution messages. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewExecutionMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).ExecutionMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).ExecutionMessage = value ?? null; } - - /// Script execution status. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewExecutionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).ExecutionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).ExecutionState = value ?? null; } - - /// Exit code returned from script execution. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public int? InstanceViewExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).ExitCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).ExitCode = value ?? default(int); } - - /// Script output stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string InstanceViewOutput { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).Output; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).Output = value ?? null; } - - /// Script start time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? InstanceViewStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).StartTime = value ?? default(global::System.DateTime); } - - /// The status information. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public System.Collections.Generic.List InstanceViewStatuses { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).Statuses; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceViewInternal)InstanceView).Statuses = value ?? null /* arrayOf */; } - - /// Internal Acessors for ErrorBlobManagedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal.ErrorBlobManagedIdentity { get => (this._errorBlobManagedIdentity = this._errorBlobManagedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity()); set { {_errorBlobManagedIdentity = value;} } } - - /// Internal Acessors for InstanceView - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal.InstanceView { get => (this._instanceView = this._instanceView ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceView()); set { {_instanceView = value;} } } - - /// Internal Acessors for OutputBlobManagedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal.OutputBlobManagedIdentity { get => (this._outputBlobManagedIdentity = this._outputBlobManagedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity()); set { {_outputBlobManagedIdentity = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for Source - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal.Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSource()); set { {_source = value;} } } - - /// Internal Acessors for SourceScriptUriManagedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandPropertiesInternal.SourceScriptUriManagedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUriManagedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUriManagedIdentity = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity _outputBlobManagedIdentity; - - /// - /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned - /// identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role - /// assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity OutputBlobManagedIdentity { get => (this._outputBlobManagedIdentity = this._outputBlobManagedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity()); set => this._outputBlobManagedIdentity = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string OutputBlobManagedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)OutputBlobManagedIdentity).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)OutputBlobManagedIdentity).ClientId = value ?? null; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string OutputBlobManagedIdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)OutputBlobManagedIdentity).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)OutputBlobManagedIdentity).ObjectId = value ?? null; } - - /// Backing field for property. - private string _outputBlobUri; - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string OutputBlobUri { get => this._outputBlobUri; set => this._outputBlobUri = value; } - - /// Backing field for property. - private System.Collections.Generic.List _parameter; - - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List Parameter { get => this._parameter; set => this._parameter = value; } - - /// Backing field for property. - private System.Collections.Generic.List _protectedParameter; - - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List ProtectedParameter { get => this._protectedParameter; set => this._protectedParameter = value; } - - /// Backing field for property. - private string _provisioningState; - - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string _runAsPassword; - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string RunAsPassword { get => this._runAsPassword; set => this._runAsPassword = value; } - - /// Backing field for property. - private string _runAsUser; - - /// Specifies the user account on the machine when executing the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string RunAsUser { get => this._runAsUser; set => this._runAsUser = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScriptUriManagedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUriManagedIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUriManagedIdentityClientId = value ?? null; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScriptUriManagedIdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUriManagedIdentityObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUriManagedIdentityObjectId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource _source; - - /// The source of the run command script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource Source { get => (this._source = this._source ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSource()); set => this._source = value; } - - /// Specifies the commandId of predefined built-in script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string SourceCommandId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).CommandId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).CommandId = value ?? null; } - - /// Specifies the script content to be executed on the machine. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string SourceScript { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).Script; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).Script = value ?? null; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string SourceScriptUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)Source).ScriptUri = value ?? null; } - - /// Backing field for property. - private int? _timeoutInSecond; - - /// The timeout in seconds to execute the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public int? TimeoutInSecond { get => this._timeoutInSecond; set => this._timeoutInSecond = value; } - - /// Creates an new instance. - public MachineRunCommandProperties() - { - - } - } - /// Describes the properties of a run command. - public partial interface IMachineRunCommandProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(bool) })] - bool? AsyncExecution { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ErrorBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string ErrorBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - string ErrorBlobUri { get; set; } - /// Script end time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script end time.", - SerializedName = @"endTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? InstanceViewEndTime { get; } - /// Script error stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script error stream.", - SerializedName = @"error", - PossibleTypes = new [] { typeof(string) })] - string InstanceViewError { get; } - /// Communicate script configuration errors or execution messages. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Communicate script configuration errors or execution messages.", - SerializedName = @"executionMessage", - PossibleTypes = new [] { typeof(string) })] - string InstanceViewExecutionMessage { get; } - /// Script execution status. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script execution status.", - SerializedName = @"executionState", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Unknown", "Pending", "Running", "Failed", "Succeeded", "TimedOut", "Canceled")] - string InstanceViewExecutionState { get; } - /// Exit code returned from script execution. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Exit code returned from script execution.", - SerializedName = @"exitCode", - PossibleTypes = new [] { typeof(int) })] - int? InstanceViewExitCode { get; } - /// Script output stream. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script output stream.", - SerializedName = @"output", - PossibleTypes = new [] { typeof(string) })] - string InstanceViewOutput { get; } - /// Script start time. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Script start time.", - SerializedName = @"startTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? InstanceViewStartTime { get; } - /// The status information. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The status information.", - SerializedName = @"statuses", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionsResourceStatus) })] - System.Collections.Generic.List InstanceViewStatuses { get; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string OutputBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string OutputBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - string OutputBlobUri { get; set; } - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - System.Collections.Generic.List Parameter { get; set; } - /// The parameters used by the script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - System.Collections.Generic.List ProtectedParameter { get; set; } - /// The provisioning state, which only appears in the response. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"The provisioning state, which only appears in the response.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - string ProvisioningState { get; } - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - string RunAsPassword { get; set; } - /// Specifies the user account on the machine when executing the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - string RunAsUser { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ScriptUriManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string ScriptUriManagedIdentityObjectId { get; set; } - /// Specifies the commandId of predefined built-in script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - string SourceCommandId { get; set; } - /// Specifies the script content to be executed on the machine. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - string SourceScript { get; set; } - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - string SourceScriptUri { get; set; } - /// The timeout in seconds to execute the run command. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - int? TimeoutInSecond { get; set; } - - } - /// Describes the properties of a run command. - internal partial interface IMachineRunCommandPropertiesInternal - - { - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - bool? AsyncExecution { get; set; } - /// - /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned - /// identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role - /// assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - /// - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity ErrorBlobManagedIdentity { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string ErrorBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string ErrorBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - string ErrorBlobUri { get; set; } - /// The machine run command instance view. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandInstanceView InstanceView { get; set; } - /// Script end time. - global::System.DateTime? InstanceViewEndTime { get; set; } - /// Script error stream. - string InstanceViewError { get; set; } - /// Communicate script configuration errors or execution messages. - string InstanceViewExecutionMessage { get; set; } - /// Script execution status. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Unknown", "Pending", "Running", "Failed", "Succeeded", "TimedOut", "Canceled")] - string InstanceViewExecutionState { get; set; } - /// Exit code returned from script execution. - int? InstanceViewExitCode { get; set; } - /// Script output stream. - string InstanceViewOutput { get; set; } - /// Script start time. - global::System.DateTime? InstanceViewStartTime { get; set; } - /// The status information. - System.Collections.Generic.List InstanceViewStatuses { get; set; } - /// - /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned - /// identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role - /// assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged - /// - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity OutputBlobManagedIdentity { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string OutputBlobManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string OutputBlobManagedIdentityObjectId { get; set; } - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - string OutputBlobUri { get; set; } - /// The parameters used by the script. - System.Collections.Generic.List Parameter { get; set; } - /// The parameters used by the script. - System.Collections.Generic.List ProtectedParameter { get; set; } - /// The provisioning state, which only appears in the response. - string ProvisioningState { get; set; } - /// - /// Specifies the user account password on the machine when executing the run command. - /// - string RunAsPassword { get; set; } - /// Specifies the user account on the machine when executing the run command. - string RunAsUser { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string ScriptUriManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string ScriptUriManagedIdentityObjectId { get; set; } - /// The source of the run command script. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource Source { get; set; } - /// Specifies the commandId of predefined built-in script. - string SourceCommandId { get; set; } - /// Specifies the script content to be executed on the machine. - string SourceScript { get; set; } - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - string SourceScriptUri { get; set; } - /// - /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case - /// of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's - /// container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under - /// VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity SourceScriptUriManagedIdentity { get; set; } - /// The timeout in seconds to execute the run command. - int? TimeoutInSecond { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.json.cs deleted file mode 100644 index d9d08e10ddd7..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandProperties.json.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the properties of a run command. - public partial class MachineRunCommandProperties - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new MachineRunCommandProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal MachineRunCommandProperties(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_source = If( json?.PropertyT("source"), out var __jsonSource) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandScriptSource.FromJson(__jsonSource) : _source;} - {_outputBlobManagedIdentity = If( json?.PropertyT("outputBlobManagedIdentity"), out var __jsonOutputBlobManagedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity.FromJson(__jsonOutputBlobManagedIdentity) : _outputBlobManagedIdentity;} - {_errorBlobManagedIdentity = If( json?.PropertyT("errorBlobManagedIdentity"), out var __jsonErrorBlobManagedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity.FromJson(__jsonErrorBlobManagedIdentity) : _errorBlobManagedIdentity;} - {_instanceView = If( json?.PropertyT("instanceView"), out var __jsonInstanceView) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandInstanceView.FromJson(__jsonInstanceView) : _instanceView;} - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameter.FromJson(__u) )) ))() : null : _parameter;} - {_protectedParameter = If( json?.PropertyT("protectedParameters"), out var __jsonProtectedParameters) ? If( __jsonProtectedParameters as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandInputParameter.FromJson(__p) )) ))() : null : _protectedParameter;} - {_asyncExecution = If( json?.PropertyT("asyncExecution"), out var __jsonAsyncExecution) ? (bool?)__jsonAsyncExecution : _asyncExecution;} - {_runAsUser = If( json?.PropertyT("runAsUser"), out var __jsonRunAsUser) ? (string)__jsonRunAsUser : (string)_runAsUser;} - {_runAsPassword = If( json?.PropertyT("runAsPassword"), out var __jsonRunAsPassword) ? (string)__jsonRunAsPassword : (string)_runAsPassword;} - {_timeoutInSecond = If( json?.PropertyT("timeoutInSeconds"), out var __jsonTimeoutInSeconds) ? (int?)__jsonTimeoutInSeconds : _timeoutInSecond;} - {_outputBlobUri = If( json?.PropertyT("outputBlobUri"), out var __jsonOutputBlobUri) ? (string)__jsonOutputBlobUri : (string)_outputBlobUri;} - {_errorBlobUri = If( json?.PropertyT("errorBlobUri"), out var __jsonErrorBlobUri) ? (string)__jsonErrorBlobUri : (string)_errorBlobUri;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._source ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._source.ToJson(null,serializationMode) : null, "source" ,container.Add ); - AddIf( null != this._outputBlobManagedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._outputBlobManagedIdentity.ToJson(null,serializationMode) : null, "outputBlobManagedIdentity" ,container.Add ); - AddIf( null != this._errorBlobManagedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._errorBlobManagedIdentity.ToJson(null,serializationMode) : null, "errorBlobManagedIdentity" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != this._instanceView ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._instanceView.ToJson(null,serializationMode) : null, "instanceView" ,container.Add ); - } - if (null != this._parameter) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.XNodeArray(); - foreach( var __x in this._parameter ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("parameters",__w); - } - if (null != this._protectedParameter) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.XNodeArray(); - foreach( var __s in this._protectedParameter ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("protectedParameters",__r); - } - AddIf( null != this._asyncExecution ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonBoolean((bool)this._asyncExecution) : null, "asyncExecution" ,container.Add ); - AddIf( null != (((object)this._runAsUser)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._runAsUser.ToString()) : null, "runAsUser" ,container.Add ); - AddIf( null != (((object)this._runAsPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._runAsPassword.ToString()) : null, "runAsPassword" ,container.Add ); - AddIf( null != this._timeoutInSecond ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNumber((int)this._timeoutInSecond) : null, "timeoutInSeconds" ,container.Add ); - AddIf( null != (((object)this._outputBlobUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._outputBlobUri.ToString()) : null, "outputBlobUri" ,container.Add ); - AddIf( null != (((object)this._errorBlobUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._errorBlobUri.ToString()) : null, "errorBlobUri" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.PowerShell.cs deleted file mode 100644 index e5aaace1c432..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.PowerShell.cs +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// Describes the script sources for run command. Use only one of script, scriptUri, commandId. - /// - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandScriptSourceTypeConverter))] - public partial class MachineRunCommandScriptSource - { - - /// - /// 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.ConnectedMachine.Models.IMachineRunCommandScriptSource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineRunCommandScriptSource(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.ConnectedMachine.Models.IMachineRunCommandScriptSource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineRunCommandScriptSource(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.ConnectedMachine.Models.IMachineRunCommandScriptSource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineRunCommandScriptSource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScriptUriManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("ScriptUriManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Script")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).Script = (string) content.GetValueForProperty("Script",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).Script, global::System.Convert.ToString); - } - if (content.Contains("ScriptUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUri = (string) content.GetValueForProperty("ScriptUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUri, global::System.Convert.ToString); - } - if (content.Contains("CommandId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).CommandId = (string) content.GetValueForProperty("CommandId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).CommandId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityClientId = (string) content.GetValueForProperty("ScriptUriManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityObjectId = (string) content.GetValueForProperty("ScriptUriManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityObjectId, 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 MachineRunCommandScriptSource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScriptUriManagedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity) content.GetValueForProperty("ScriptUriManagedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentity, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Script")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).Script = (string) content.GetValueForProperty("Script",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).Script, global::System.Convert.ToString); - } - if (content.Contains("ScriptUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUri = (string) content.GetValueForProperty("ScriptUri",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUri, global::System.Convert.ToString); - } - if (content.Contains("CommandId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).CommandId = (string) content.GetValueForProperty("CommandId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).CommandId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityClientId = (string) content.GetValueForProperty("ScriptUriManagedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityClientId, global::System.Convert.ToString); - } - if (content.Contains("ScriptUriManagedIdentityObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityObjectId = (string) content.GetValueForProperty("ScriptUriManagedIdentityObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal)this).ScriptUriManagedIdentityObjectId, 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.ConnectedMachine.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 script sources for run command. Use only one of script, scriptUri, commandId. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandScriptSourceTypeConverter))] - public partial interface IMachineRunCommandScriptSource - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.TypeConverter.cs deleted file mode 100644 index c1458fae5f0b..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class MachineRunCommandScriptSourceTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return MachineRunCommandScriptSource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return MachineRunCommandScriptSource.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return MachineRunCommandScriptSource.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.cs deleted file mode 100644 index 2cc134d3809d..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// Describes the script sources for run command. Use only one of script, scriptUri, commandId. - /// - public partial class MachineRunCommandScriptSource : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal - { - - /// Backing field for property. - private string _commandId; - - /// Specifies the commandId of predefined built-in script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string CommandId { get => this._commandId; set => this._commandId = value; } - - /// Internal Acessors for ScriptUriManagedIdentity - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSourceInternal.ScriptUriManagedIdentity { get => (this._scriptUriManagedIdentity = this._scriptUriManagedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity()); set { {_scriptUriManagedIdentity = value;} } } - - /// Backing field for property. - private string _script; - - /// Specifies the script content to be executed on the machine. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Script { get => this._script; set => this._script = value; } - - /// Backing field for property. - private string _scriptUri; - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ScriptUri { get => this._scriptUri; set => this._scriptUri = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity _scriptUriManagedIdentity; - - /// - /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case - /// of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's - /// container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under - /// VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity ScriptUriManagedIdentity { get => (this._scriptUriManagedIdentity = this._scriptUriManagedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity()); set => this._scriptUriManagedIdentity = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScriptUriManagedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ScriptUriManagedIdentity).ClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ScriptUriManagedIdentity).ClientId = value ?? null; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScriptUriManagedIdentityObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ScriptUriManagedIdentity).ObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)ScriptUriManagedIdentity).ObjectId = value ?? null; } - - /// Creates an new instance. - public MachineRunCommandScriptSource() - { - - } - } - /// Describes the script sources for run command. Use only one of script, scriptUri, commandId. - public partial interface IMachineRunCommandScriptSource : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Specifies the commandId of predefined built-in script. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - string CommandId { get; set; } - /// Specifies the script content to be executed on the machine. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - string Script { get; set; } - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - string ScriptUri { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ScriptUriManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string ScriptUriManagedIdentityObjectId { get; set; } - - } - /// Describes the script sources for run command. Use only one of script, scriptUri, commandId. - internal partial interface IMachineRunCommandScriptSourceInternal - - { - /// Specifies the commandId of predefined built-in script. - string CommandId { get; set; } - /// Specifies the script content to be executed on the machine. - string Script { get; set; } - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - string ScriptUri { get; set; } - /// - /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case - /// of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's - /// container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under - /// VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity ScriptUriManagedIdentity { get; set; } - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string ScriptUriManagedIdentityClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string ScriptUriManagedIdentityObjectId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.json.cs deleted file mode 100644 index b67923c1be93..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandScriptSource.json.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// Describes the script sources for run command. Use only one of script, scriptUri, commandId. - /// - public partial class MachineRunCommandScriptSource - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandScriptSource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new MachineRunCommandScriptSource(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal MachineRunCommandScriptSource(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_scriptUriManagedIdentity = If( json?.PropertyT("scriptUriManagedIdentity"), out var __jsonScriptUriManagedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.RunCommandManagedIdentity.FromJson(__jsonScriptUriManagedIdentity) : _scriptUriManagedIdentity;} - {_script = If( json?.PropertyT("script"), out var __jsonScript) ? (string)__jsonScript : (string)_script;} - {_scriptUri = If( json?.PropertyT("scriptUri"), out var __jsonScriptUri) ? (string)__jsonScriptUri : (string)_scriptUri;} - {_commandId = If( json?.PropertyT("commandId"), out var __jsonCommandId) ? (string)__jsonCommandId : (string)_commandId;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._scriptUriManagedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._scriptUriManagedIdentity.ToJson(null,serializationMode) : null, "scriptUriManagedIdentity" ,container.Add ); - AddIf( null != (((object)this._script)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._script.ToString()) : null, "script" ,container.Add ); - AddIf( null != (((object)this._scriptUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._scriptUri.ToString()) : null, "scriptUri" ,container.Add ); - AddIf( null != (((object)this._commandId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._commandId.ToString()) : null, "commandId" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.PowerShell.cs deleted file mode 100644 index cc117d69d272..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.PowerShell.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes a Machine Extension Update. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandUpdateTypeConverter))] - public partial class MachineRunCommandUpdate - { - - /// - /// 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.ConnectedMachine.Models.IMachineRunCommandUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineRunCommandUpdate(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.ConnectedMachine.Models.IMachineRunCommandUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineRunCommandUpdate(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.ConnectedMachine.Models.IMachineRunCommandUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineRunCommandUpdate(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdateTagsTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MachineRunCommandUpdate(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdateTagsTypeConverter.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.ConnectedMachine.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 a Machine Extension Update. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandUpdateTypeConverter))] - public partial interface IMachineRunCommandUpdate - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.TypeConverter.cs deleted file mode 100644 index 2bc18794b829..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class MachineRunCommandUpdateTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandUpdate ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandUpdate).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return MachineRunCommandUpdate.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return MachineRunCommandUpdate.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return MachineRunCommandUpdate.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.cs deleted file mode 100644 index da3a1754a31f..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes a Machine Extension Update. - public partial class MachineRunCommandUpdate : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandUpdate, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandUpdateInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdate __resourceUpdate = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdate(); - - /// Resource tags - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags Tags { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)__resourceUpdate).Tags; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal)__resourceUpdate).Tags = value ?? null /* model class */; } - - /// Creates an new instance. - public MachineRunCommandUpdate() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resourceUpdate), __resourceUpdate); - await eventListener.AssertObjectIsValid(nameof(__resourceUpdate), __resourceUpdate); - } - } - /// Describes a Machine Extension Update. - public partial interface IMachineRunCommandUpdate : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdate - { - - } - /// Describes a Machine Extension Update. - internal partial interface IMachineRunCommandUpdateInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateInternal - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.json.cs deleted file mode 100644 index ce7a422b134d..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandUpdate.json.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes a Machine Extension Update. - public partial class MachineRunCommandUpdate - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandUpdate. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandUpdate. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new MachineRunCommandUpdate(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal MachineRunCommandUpdate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __resourceUpdate = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdate(json); - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __resourceUpdate?.ToJson(container, serializationMode); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.PowerShell.cs deleted file mode 100644 index 3bb49bc683e1..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.PowerShell.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes the Run Commands List Result. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandsListResultTypeConverter))] - public partial class MachineRunCommandsListResult - { - - /// - /// 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.ConnectedMachine.Models.IMachineRunCommandsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineRunCommandsListResult(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.ConnectedMachine.Models.IMachineRunCommandsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineRunCommandsListResult(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.ConnectedMachine.Models.IMachineRunCommandsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineRunCommandsListResult(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.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)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 MachineRunCommandsListResult(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.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommandTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResultInternal)this).NextLink, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Run Commands List Result. - [System.ComponentModel.TypeConverter(typeof(MachineRunCommandsListResultTypeConverter))] - public partial interface IMachineRunCommandsListResult - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.TypeConverter.cs deleted file mode 100644 index 9fc727f9f8ed..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class MachineRunCommandsListResultTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return MachineRunCommandsListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return MachineRunCommandsListResult.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return MachineRunCommandsListResult.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.cs deleted file mode 100644 index 21c8bd7fb9c1..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the Run Commands List Result. - public partial class MachineRunCommandsListResult : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResultInternal - { - - /// Backing field for property. - private string _nextLink; - - /// - /// The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private System.Collections.Generic.List _value; - - /// The list of run commands - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public MachineRunCommandsListResult() - { - - } - } - /// Describes the Run Commands List Result. - public partial interface IMachineRunCommandsListResult : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// - /// The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of run commands - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The list of run commands", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) })] - System.Collections.Generic.List Value { get; set; } - - } - /// Describes the Run Commands List Result. - internal partial interface IMachineRunCommandsListResultInternal - - { - /// - /// The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - /// - string NextLink { get; set; } - /// The list of run commands - System.Collections.Generic.List Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.json.cs deleted file mode 100644 index 4e841204a566..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/MachineRunCommandsListResult.json.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the Run Commands List Result. - public partial class MachineRunCommandsListResult - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new MachineRunCommandsListResult(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal MachineRunCommandsListResult(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand.FromJson(__u) )) ))() : null : _value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.PowerShell.cs deleted file mode 100644 index ab711a1cf271..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.PowerShell.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(NetworkConfigurationTypeConverter))] - public partial class NetworkConfiguration - { - - /// - /// 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.ConnectedMachine.Models.INetworkConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new NetworkConfiguration(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.ConnectedMachine.Models.INetworkConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new NetworkConfiguration(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.ConnectedMachine.Models.INetworkConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal NetworkConfiguration(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.ConnectedMachine.Models.INetworkConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfigurationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("KeyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties) content.GetValueForProperty("KeyProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeResourceId = (string) content.GetValueForProperty("ScopeResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeResourceId, global::System.Convert.ToString); - } - if (content.Contains("KeyPropertyClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyClientPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyClientPublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("KeyPropertyCandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyCandidatePublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyCandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyCandidatePublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("ClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKey = (string) content.GetValueForProperty("ClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKey, global::System.Convert.ToString); - } - if (content.Contains("ClientPublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ClientPublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyRenewAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKey = (string) content.GetValueForProperty("CandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKey, global::System.Convert.ToString); - } - if (content.Contains("CandidatePublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyRenewAfter, (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 NetworkConfiguration(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.ConnectedMachine.Models.INetworkConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfigurationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("KeyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties) content.GetValueForProperty("KeyProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("ScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeId = (string) content.GetValueForProperty("ScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeId, global::System.Convert.ToString); - } - if (content.Contains("ScopeResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeResourceId = (string) content.GetValueForProperty("ScopeResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ScopeResourceId, global::System.Convert.ToString); - } - if (content.Contains("KeyPropertyClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyClientPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyClientPublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("KeyPropertyCandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyCandidatePublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyCandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).KeyPropertyCandidatePublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("ClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKey = (string) content.GetValueForProperty("ClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKey, global::System.Convert.ToString); - } - if (content.Contains("ClientPublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ClientPublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).ClientPublicKeyRenewAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKey = (string) content.GetValueForProperty("CandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKey, global::System.Convert.ToString); - } - if (content.Contains("CandidatePublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal)this).CandidatePublicKeyRenewAfter, (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.ConnectedMachine.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(NetworkConfigurationTypeConverter))] - public partial interface INetworkConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.TypeConverter.cs deleted file mode 100644 index 251188728f47..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class NetworkConfigurationTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return NetworkConfiguration.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return NetworkConfiguration.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return NetworkConfiguration.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.cs deleted file mode 100644 index 54e5b96fdbec..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - public partial class NetworkConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGenerated __proxyResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ProxyResourceAutoGenerated(); - - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string CandidatePublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKey; } - - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? CandidatePublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKeyNotAfter; } - - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? CandidatePublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKeyRenewAfter; } - - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ClientPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKey; } - - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? ClientPublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKeyNotAfter; } - - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? ClientPublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKeyRenewAfter; } - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id; } - - /// Resource location - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).Location = value ?? null; } - - /// Internal Acessors for CandidatePublicKey - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.CandidatePublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKey = value; } - - /// Internal Acessors for CandidatePublicKeyNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.CandidatePublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKeyNotAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKeyNotAfter = value; } - - /// Internal Acessors for CandidatePublicKeyRenewAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.CandidatePublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKeyRenewAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).CandidatePublicKeyRenewAfter = value; } - - /// Internal Acessors for ClientPublicKey - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.ClientPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKey = value; } - - /// Internal Acessors for ClientPublicKeyNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.ClientPublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKeyNotAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKeyNotAfter = value; } - - /// Internal Acessors for ClientPublicKeyRenewAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.ClientPublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKeyRenewAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).ClientPublicKeyRenewAfter = value; } - - /// Internal Acessors for KeyProperty - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.KeyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).KeyProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).KeyProperty = value; } - - /// Internal Acessors for KeyPropertyCandidatePublicKey - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.KeyPropertyCandidatePublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).KeyPropertyCandidatePublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).KeyPropertyCandidatePublicKey = value; } - - /// Internal Acessors for KeyPropertyClientPublicKey - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.KeyPropertyClientPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).KeyPropertyClientPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).KeyPropertyClientPublicKey = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfigurationProperties()); set { {_property = value;} } } - - /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationInternal.TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).TenantId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties _property; - - /// Network configuration properties - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfigurationProperties()); set => this._property = value; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); } - - /// Associated Network Configuration Scope Id (GUID) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).NetworkConfigurationScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).NetworkConfigurationScopeId = value ?? null; } - - /// Associated Network Configuration Scope Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ScopeResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).NetworkConfigurationScopeResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).NetworkConfigurationScopeResourceId = value ?? null; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedByType = value ?? null; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedByType = value ?? null; } - - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)Property).TenantId; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type; } - - /// Creates an new instance. - public NetworkConfiguration() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__proxyResourceAutoGenerated), __proxyResourceAutoGenerated); - await eventListener.AssertObjectIsValid(nameof(__proxyResourceAutoGenerated), __proxyResourceAutoGenerated); - } - } - public partial interface INetworkConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGenerated - { - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Public key", - SerializedName = @"publicKey", - PossibleTypes = new [] { typeof(string) })] - string CandidatePublicKey { get; } - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Key expiration date", - SerializedName = @"notAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CandidatePublicKeyNotAfter { get; } - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Recommended key renewal date", - SerializedName = @"renewAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CandidatePublicKeyRenewAfter { get; } - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Public key", - SerializedName = @"publicKey", - PossibleTypes = new [] { typeof(string) })] - string ClientPublicKey { get; } - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Key expiration date", - SerializedName = @"notAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? ClientPublicKeyNotAfter { get; } - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Recommended key renewal date", - SerializedName = @"renewAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? ClientPublicKeyRenewAfter { get; } - /// Resource location - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = false, - Description = @"Resource location", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string Location { get; set; } - /// Associated Network Configuration Scope Id (GUID) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Associated Network Configuration Scope Id (GUID)", - SerializedName = @"networkConfigurationScopeId", - PossibleTypes = new [] { typeof(string) })] - string ScopeId { get; set; } - /// Associated Network Configuration Scope Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Associated Network Configuration Scope Resource Id", - SerializedName = @"networkConfigurationScopeResourceId", - PossibleTypes = new [] { typeof(string) })] - string ScopeResourceId { get; set; } - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Azure resource tenant Id", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string TenantId { get; } - - } - internal partial interface INetworkConfigurationInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGeneratedInternal - { - /// Public key - string CandidatePublicKey { get; set; } - /// Key expiration date - global::System.DateTime? CandidatePublicKeyNotAfter { get; set; } - /// Recommended key renewal date - global::System.DateTime? CandidatePublicKeyRenewAfter { get; set; } - /// Public key - string ClientPublicKey { get; set; } - /// Key expiration date - global::System.DateTime? ClientPublicKeyNotAfter { get; set; } - /// Recommended key renewal date - global::System.DateTime? ClientPublicKeyRenewAfter { get; set; } - /// Public key information for client authentication - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties KeyProperty { get; set; } - /// Candidate public key details - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails KeyPropertyCandidatePublicKey { get; set; } - /// Current public key details - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails KeyPropertyClientPublicKey { get; set; } - /// Resource location - string Location { get; set; } - /// Network configuration properties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties Property { get; set; } - /// Associated Network Configuration Scope Id (GUID) - string ScopeId { get; set; } - /// Associated Network Configuration Scope Resource Id - string ScopeResourceId { get; set; } - /// Azure resource tenant Id - string TenantId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.json.cs deleted file mode 100644 index ee27ee8a0630..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfiguration.json.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - public partial class NetworkConfiguration - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new NetworkConfiguration(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal NetworkConfiguration(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __proxyResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ProxyResourceAutoGenerated(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.NetworkConfigurationProperties.FromJson(__jsonProperties) : _property;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __proxyResourceAutoGenerated?.ToJson(container, serializationMode); - AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.PowerShell.cs deleted file mode 100644 index 61e667f5b9c8..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.PowerShell.cs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Network configuration properties - [System.ComponentModel.TypeConverter(typeof(NetworkConfigurationPropertiesTypeConverter))] - public partial class NetworkConfigurationProperties - { - - /// - /// 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.ConnectedMachine.Models.INetworkConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new NetworkConfigurationProperties(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.ConnectedMachine.Models.INetworkConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new NetworkConfigurationProperties(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.ConnectedMachine.Models.INetworkConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal NetworkConfigurationProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("KeyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties) content.GetValueForProperty("KeyProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeId = (string) content.GetValueForProperty("NetworkConfigurationScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationScopeResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeResourceId = (string) content.GetValueForProperty("NetworkConfigurationScopeResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeResourceId, global::System.Convert.ToString); - } - if (content.Contains("KeyPropertyClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyClientPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyClientPublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("KeyPropertyCandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyCandidatePublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyCandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyCandidatePublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("ClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKey = (string) content.GetValueForProperty("ClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKey, global::System.Convert.ToString); - } - if (content.Contains("ClientPublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ClientPublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyRenewAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKey = (string) content.GetValueForProperty("CandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKey, global::System.Convert.ToString); - } - if (content.Contains("CandidatePublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyRenewAfter, (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 NetworkConfigurationProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("KeyProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties) content.GetValueForProperty("KeyProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeId = (string) content.GetValueForProperty("NetworkConfigurationScopeId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationScopeResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeResourceId = (string) content.GetValueForProperty("NetworkConfigurationScopeResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).NetworkConfigurationScopeResourceId, global::System.Convert.ToString); - } - if (content.Contains("KeyPropertyClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyClientPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyClientPublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("KeyPropertyCandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyCandidatePublicKey = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails) content.GetValueForProperty("KeyPropertyCandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).KeyPropertyCandidatePublicKey, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("ClientPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKey = (string) content.GetValueForProperty("ClientPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKey, global::System.Convert.ToString); - } - if (content.Contains("ClientPublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ClientPublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("ClientPublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).ClientPublicKeyRenewAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKey = (string) content.GetValueForProperty("CandidatePublicKey",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKey, global::System.Convert.ToString); - } - if (content.Contains("CandidatePublicKeyNotAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyNotAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyNotAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyNotAfter, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CandidatePublicKeyRenewAfter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyRenewAfter = (global::System.DateTime?) content.GetValueForProperty("CandidatePublicKeyRenewAfter",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal)this).CandidatePublicKeyRenewAfter, (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.ConnectedMachine.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(); - } - } - /// Network configuration properties - [System.ComponentModel.TypeConverter(typeof(NetworkConfigurationPropertiesTypeConverter))] - public partial interface INetworkConfigurationProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.TypeConverter.cs deleted file mode 100644 index 2017a742cadf..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.TypeConverter.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class NetworkConfigurationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return NetworkConfigurationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return NetworkConfigurationProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return NetworkConfigurationProperties.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.cs deleted file mode 100644 index 21fb75446233..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Network configuration properties - public partial class NetworkConfigurationProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal - { - - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string CandidatePublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyPublicKey; } - - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? CandidatePublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyNotAfter; } - - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? CandidatePublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyRenewAfter; } - - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string ClientPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyPublicKey; } - - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? ClientPublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyNotAfter; } - - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public global::System.DateTime? ClientPublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyRenewAfter; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties _keyProperty; - - /// Public key information for client authentication - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties KeyProperty { get => (this._keyProperty = this._keyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyProperties()); } - - /// Backing field for property. - private string _location; - - /// Resource location - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Location { get => this._location; set => this._location = value; } - - /// Internal Acessors for CandidatePublicKey - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.CandidatePublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyPublicKey = value; } - - /// Internal Acessors for CandidatePublicKeyNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.CandidatePublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyNotAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyNotAfter = value; } - - /// Internal Acessors for CandidatePublicKeyRenewAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.CandidatePublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyRenewAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKeyRenewAfter = value; } - - /// Internal Acessors for ClientPublicKey - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.ClientPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyPublicKey = value; } - - /// Internal Acessors for ClientPublicKeyNotAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.ClientPublicKeyNotAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyNotAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyNotAfter = value; } - - /// Internal Acessors for ClientPublicKeyRenewAfter - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.ClientPublicKeyRenewAfter { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyRenewAfter; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKeyRenewAfter = value; } - - /// Internal Acessors for KeyProperty - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.KeyProperty { get => (this._keyProperty = this._keyProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyProperties()); set { {_keyProperty = value;} } } - - /// Internal Acessors for KeyPropertyCandidatePublicKey - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.KeyPropertyCandidatePublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).CandidatePublicKey = value; } - - /// Internal Acessors for KeyPropertyClientPublicKey - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.KeyPropertyClientPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyPropertiesInternal)KeyProperty).ClientPublicKey = value; } - - /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationPropertiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } - - /// Backing field for property. - private string _networkConfigurationScopeId; - - /// Associated Network Configuration Scope Id (GUID) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string NetworkConfigurationScopeId { get => this._networkConfigurationScopeId; set => this._networkConfigurationScopeId = value; } - - /// Backing field for property. - private string _networkConfigurationScopeResourceId; - - /// Associated Network Configuration Scope Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string NetworkConfigurationScopeResourceId { get => this._networkConfigurationScopeResourceId; set => this._networkConfigurationScopeResourceId = value; } - - /// Backing field for property. - private string _tenantId; - - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string TenantId { get => this._tenantId; } - - /// Creates an new instance. - public NetworkConfigurationProperties() - { - - } - } - /// Network configuration properties - public partial interface INetworkConfigurationProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Public key", - SerializedName = @"publicKey", - PossibleTypes = new [] { typeof(string) })] - string CandidatePublicKey { get; } - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Key expiration date", - SerializedName = @"notAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CandidatePublicKeyNotAfter { get; } - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Recommended key renewal date", - SerializedName = @"renewAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CandidatePublicKeyRenewAfter { get; } - /// Public key - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Public key", - SerializedName = @"publicKey", - PossibleTypes = new [] { typeof(string) })] - string ClientPublicKey { get; } - /// Key expiration date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Key expiration date", - SerializedName = @"notAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? ClientPublicKeyNotAfter { get; } - /// Recommended key renewal date - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Recommended key renewal date", - SerializedName = @"renewAfter", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? ClientPublicKeyRenewAfter { get; } - /// Resource location - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = false, - Description = @"Resource location", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string Location { get; set; } - /// Associated Network Configuration Scope Id (GUID) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Associated Network Configuration Scope Id (GUID)", - SerializedName = @"networkConfigurationScopeId", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationScopeId { get; set; } - /// Associated Network Configuration Scope Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Associated Network Configuration Scope Resource Id", - SerializedName = @"networkConfigurationScopeResourceId", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationScopeResourceId { get; set; } - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Azure resource tenant Id", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string TenantId { get; } - - } - /// Network configuration properties - internal partial interface INetworkConfigurationPropertiesInternal - - { - /// Public key - string CandidatePublicKey { get; set; } - /// Key expiration date - global::System.DateTime? CandidatePublicKeyNotAfter { get; set; } - /// Recommended key renewal date - global::System.DateTime? CandidatePublicKeyRenewAfter { get; set; } - /// Public key - string ClientPublicKey { get; set; } - /// Key expiration date - global::System.DateTime? ClientPublicKeyNotAfter { get; set; } - /// Recommended key renewal date - global::System.DateTime? ClientPublicKeyRenewAfter { get; set; } - /// Public key information for client authentication - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyProperties KeyProperty { get; set; } - /// Candidate public key details - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails KeyPropertyCandidatePublicKey { get; set; } - /// Current public key details - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IKeyDetails KeyPropertyClientPublicKey { get; set; } - /// Resource location - string Location { get; set; } - /// Associated Network Configuration Scope Id (GUID) - string NetworkConfigurationScopeId { get; set; } - /// Associated Network Configuration Scope Resource Id - string NetworkConfigurationScopeResourceId { get; set; } - /// Azure resource tenant Id - string TenantId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.json.cs deleted file mode 100644 index 2cae18db6dda..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkConfigurationProperties.json.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Network configuration properties - public partial class NetworkConfigurationProperties - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new NetworkConfigurationProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal NetworkConfigurationProperties(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_keyProperty = If( json?.PropertyT("keyProperties"), out var __jsonKeyProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.KeyProperties.FromJson(__jsonKeyProperties) : _keyProperty;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} - {_networkConfigurationScopeId = If( json?.PropertyT("networkConfigurationScopeId"), out var __jsonNetworkConfigurationScopeId) ? (string)__jsonNetworkConfigurationScopeId : (string)_networkConfigurationScopeId;} - {_networkConfigurationScopeResourceId = If( json?.PropertyT("networkConfigurationScopeResourceId"), out var __jsonNetworkConfigurationScopeResourceId) ? (string)__jsonNetworkConfigurationScopeResourceId : (string)_networkConfigurationScopeResourceId;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != this._keyProperty ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._keyProperty.ToJson(null,serializationMode) : null, "keyProperties" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate)) - { - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); - } - AddIf( null != (((object)this._networkConfigurationScopeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._networkConfigurationScopeId.ToString()) : null, "networkConfigurationScopeId" ,container.Add ); - AddIf( null != (((object)this._networkConfigurationScopeResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._networkConfigurationScopeResourceId.ToString()) : null, "networkConfigurationScopeResourceId" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.PowerShell.cs similarity index 69% rename from generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.PowerShell.cs rename to generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.PowerShell.cs index 9dc3c216eff3..c0390af98f27 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.PowerShell.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.PowerShell.cs @@ -7,9 +7,9 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models { using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - /// Settings Gateway properties - [System.ComponentModel.TypeConverter(typeof(SettingsGatewayPropertiesTypeConverter))] - public partial class SettingsGatewayProperties + /// Result of network security perimeter configurations. + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationReconcileResultTypeConverter))] + public partial class NetworkSecurityPerimeterConfigurationReconcileResult { /// @@ -63,44 +63,49 @@ public partial class SettingsGatewayProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new SettingsGatewayProperties(content); + return new NetworkSecurityPerimeterConfigurationReconcileResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new SettingsGatewayProperties(content); + return new NetworkSecurityPerimeterConfigurationReconcileResult(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content + /// from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal SettingsGatewayProperties(global::System.Collections.IDictionary content) + internal NetworkSecurityPerimeterConfigurationReconcileResult(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -109,19 +114,19 @@ internal SettingsGatewayProperties(global::System.Collections.IDictionary conten return; } // actually deserialize - if (content.Contains("GatewayResourceId")) + if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayPropertiesInternal)this).GatewayResourceId = (string) content.GetValueForProperty("GatewayResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayPropertiesInternal)this).GatewayResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResultInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResultInternal)this).Location, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal SettingsGatewayProperties(global::System.Management.Automation.PSObject content) + internal NetworkSecurityPerimeterConfigurationReconcileResult(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -130,9 +135,9 @@ internal SettingsGatewayProperties(global::System.Management.Automation.PSObject return; } // actually deserialize - if (content.Contains("GatewayResourceId")) + if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayPropertiesInternal)this).GatewayResourceId = (string) content.GetValueForProperty("GatewayResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayPropertiesInternal)this).GatewayResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResultInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResultInternal)this).Location, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,9 +159,9 @@ public override string ToString() return ToJsonString(); } } - /// Settings Gateway properties - [System.ComponentModel.TypeConverter(typeof(SettingsGatewayPropertiesTypeConverter))] - public partial interface ISettingsGatewayProperties + /// Result of network security perimeter configurations. + [System.ComponentModel.TypeConverter(typeof(NetworkSecurityPerimeterConfigurationReconcileResultTypeConverter))] + public partial interface INetworkSecurityPerimeterConfigurationReconcileResult { diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.TypeConverter.cs similarity index 79% rename from generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.TypeConverter.cs rename to generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.TypeConverter.cs index ac3b1028485a..c9fa8462032c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/HybridIdentityMetadataProperties.TypeConverter.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.TypeConverter.cs @@ -8,9 +8,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class HybridIdentityMetadataPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class NetworkSecurityPerimeterConfigurationReconcileResultTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -26,13 +27,14 @@ public partial class HybridIdentityMetadataPropertiesTypeConverter : global::Sys public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the + /// Determines if the converter can convert the parameter to the /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a + /// type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -95,32 +97,35 @@ public static bool CanConvertFrom(dynamic sourceValue) /// not used by this TypeConverter. /// when set to true, will ignore the case when converting. /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable + /// conversion. /// public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable + /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridIdentityMetadataProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult).IsAssignableFrom(type)) { return sourceValue; } try { - return HybridIdentityMetadataProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return NetworkSecurityPerimeterConfigurationReconcileResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -128,11 +133,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybrid } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return HybridIdentityMetadataProperties.DeserializeFromPSObject(sourceValue); + return NetworkSecurityPerimeterConfigurationReconcileResult.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return HybridIdentityMetadataProperties.DeserializeFromDictionary(sourceValue); + return NetworkSecurityPerimeterConfigurationReconcileResult.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.cs new file mode 100644 index 000000000000..2a1957530b4e --- /dev/null +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; + + /// Result of network security perimeter configurations. + public partial class NetworkSecurityPerimeterConfigurationReconcileResult : + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult, + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResultInternal + { + + /// Backing field for property. + private string _location; + + /// The URL of the resource used to check the status of the asynchronous operation. + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Creates an new instance. + /// + public NetworkSecurityPerimeterConfigurationReconcileResult() + { + + } + } + /// Result of network security perimeter configurations. + public partial interface INetworkSecurityPerimeterConfigurationReconcileResult : + Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable + { + /// The URL of the resource used to check the status of the asynchronous operation. + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the resource used to check the status of the asynchronous operation.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + + } + /// Result of network security perimeter configurations. + internal partial interface INetworkSecurityPerimeterConfigurationReconcileResultInternal + + { + /// The URL of the resource used to check the status of the asynchronous operation. + string Location { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.json.cs similarity index 76% rename from generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.json.cs rename to generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.json.cs index df6b7c974f1d..527a7bdf30ed 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/GatewayUpdate.json.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/NetworkSecurityPerimeterConfigurationReconcileResult.json.cs @@ -7,8 +7,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - /// Describes a License Update. - public partial class GatewayUpdate + /// Result of network security perimeter configurations. + public partial class NetworkSecurityPerimeterConfigurationReconcileResult { /// @@ -54,22 +54,23 @@ public partial class GatewayUpdate partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IGatewayUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new GatewayUpdate(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new NetworkSecurityPerimeterConfigurationReconcileResult(json) : null; } /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal GatewayUpdate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) + internal NetworkSecurityPerimeterConfigurationReconcileResult(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -77,19 +78,20 @@ internal GatewayUpdate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runti { return; } - __resourceUpdate = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceUpdate(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.GatewayUpdateProperties.FromJson(__jsonProperties) : _property;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } /// - /// Serializes this instance of into a . + /// 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 . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) { @@ -101,8 +103,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode { return container; } - __resourceUpdate?.ToJson(container, serializationMode); - AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.PowerShell.cs deleted file mode 100644 index e6df74905e2e..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.PowerShell.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Describes the properties of a run command parameter. - [System.ComponentModel.TypeConverter(typeof(RunCommandInputParameterTypeConverter))] - public partial class RunCommandInputParameter - { - - /// - /// 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.ConnectedMachine.Models.IRunCommandInputParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RunCommandInputParameter(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.ConnectedMachine.Models.IRunCommandInputParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RunCommandInputParameter(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.ConnectedMachine.Models.IRunCommandInputParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RunCommandInputParameter(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.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Value, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RunCommandInputParameter(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.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameterInternal)this).Value, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 a run command parameter. - [System.ComponentModel.TypeConverter(typeof(RunCommandInputParameterTypeConverter))] - public partial interface IRunCommandInputParameter - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.TypeConverter.cs deleted file mode 100644 index 6b6edef6289a..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class RunCommandInputParameterTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return RunCommandInputParameter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return RunCommandInputParameter.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return RunCommandInputParameter.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.cs deleted file mode 100644 index 220643848568..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the properties of a run command parameter. - public partial class RunCommandInputParameter : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameterInternal - { - - /// Backing field for property. - private string _name; - - /// The run command parameter name. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private string _value; - - /// The run command parameter value. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public RunCommandInputParameter() - { - - } - } - /// Describes the properties of a run command parameter. - public partial interface IRunCommandInputParameter : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// The run command parameter name. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The run command parameter name.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; set; } - /// The run command parameter value. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"The run command parameter value.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(string) })] - string Value { get; set; } - - } - /// Describes the properties of a run command parameter. - internal partial interface IRunCommandInputParameterInternal - - { - /// The run command parameter name. - string Name { get; set; } - /// The run command parameter value. - string Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.json.cs deleted file mode 100644 index 2506f66eaa45..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandInputParameter.json.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Describes the properties of a run command parameter. - public partial class RunCommandInputParameter - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new RunCommandInputParameter(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal RunCommandInputParameter(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.PowerShell.cs deleted file mode 100644 index b9c8105e99cd..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.PowerShell.cs +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage - /// blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure - /// the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with - /// 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, - /// errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// - [System.ComponentModel.TypeConverter(typeof(RunCommandManagedIdentityTypeConverter))] - public partial class RunCommandManagedIdentity - { - - /// - /// 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.ConnectedMachine.Models.IRunCommandManagedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RunCommandManagedIdentity(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.ConnectedMachine.Models.IRunCommandManagedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RunCommandManagedIdentity(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.ConnectedMachine.Models.IRunCommandManagedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RunCommandManagedIdentity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ClientId, global::System.Convert.ToString); - } - if (content.Contains("ObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ObjectId, 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 RunCommandManagedIdentity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ClientId, global::System.Convert.ToString); - } - if (content.Contains("ObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ObjectId = (string) content.GetValueForProperty("ObjectId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal)this).ObjectId, 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.ConnectedMachine.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(); - } - } - /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage - /// blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure - /// the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with - /// 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, - /// errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - [System.ComponentModel.TypeConverter(typeof(RunCommandManagedIdentityTypeConverter))] - public partial interface IRunCommandManagedIdentity - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.TypeConverter.cs deleted file mode 100644 index 71f73445fc5a..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class RunCommandManagedIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return RunCommandManagedIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return RunCommandManagedIdentity.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return RunCommandManagedIdentity.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.cs deleted file mode 100644 index 2481b3e37e9f..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage - /// blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure - /// the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with - /// 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, - /// errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// - public partial class RunCommandManagedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentityInternal - { - - /// Backing field for property. - private string _clientId; - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ClientId { get => this._clientId; set => this._clientId = value; } - - /// Backing field for property. - private string _objectId; - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string ObjectId { get => this._objectId; set => this._objectId = value; } - - /// Creates an new instance. - public RunCommandManagedIdentity() - { - - } - } - /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage - /// blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure - /// the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with - /// 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, - /// errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - public partial interface IRunCommandManagedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - string ObjectId { get; set; } - - } - /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage - /// blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure - /// the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with - /// 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, - /// errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - internal partial interface IRunCommandManagedIdentityInternal - - { - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - string ClientId { get; set; } - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - string ObjectId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.json.cs deleted file mode 100644 index 0b9451c4d56c..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/RunCommandManagedIdentity.json.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage - /// blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure - /// the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with - /// 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, - /// errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity - /// and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// - public partial class RunCommandManagedIdentity - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandManagedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new RunCommandManagedIdentity(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal RunCommandManagedIdentity(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} - {_objectId = If( json?.PropertyT("objectId"), out var __jsonObjectId) ? (string)__jsonObjectId : (string)_objectId;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); - AddIf( null != (((object)this._objectId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._objectId.ToString()) : null, "objectId" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.PowerShell.cs deleted file mode 100644 index 4bfdc3b3f525..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.PowerShell.cs +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(SettingsTypeConverter))] - public partial class Settings - { - - /// - /// 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.ConnectedMachine.Models.ISettings DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Settings(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.ConnectedMachine.Models.ISettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Settings(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.ConnectedMachine.Models.ISettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Settings(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.ConnectedMachine.Models.ISettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("GatewayProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties) content.GetValueForProperty("GatewayProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("GatewayPropertyGatewayResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayPropertyGatewayResourceId = (string) content.GetValueForProperty("GatewayPropertyGatewayResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayPropertyGatewayResourceId, 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 Settings(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.ConnectedMachine.Models.ISettingsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("GatewayProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties) content.GetValueForProperty("GatewayProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("GatewayPropertyGatewayResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayPropertyGatewayResourceId = (string) content.GetValueForProperty("GatewayPropertyGatewayResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal)this).GatewayPropertyGatewayResourceId, 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.ConnectedMachine.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(SettingsTypeConverter))] - public partial interface ISettings - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.TypeConverter.cs deleted file mode 100644 index eb7656991680..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.TypeConverter.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class SettingsTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Settings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Settings.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Settings.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.cs deleted file mode 100644 index b695c5b56ecc..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - public partial class Settings : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGenerated __proxyResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ProxyResourceAutoGenerated(); - - /// Associated Gateway Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string GatewayPropertyGatewayResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)Property).GatewayPropertyGatewayResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)Property).GatewayPropertyGatewayResourceId = value ?? null; } - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type = value; } - - /// Internal Acessors for GatewayProperty - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal.GatewayProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)Property).GatewayProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)Property).GatewayProperty = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsProperties()); set { {_property = value;} } } - - /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsInternal.TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)Property).TenantId = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties _property; - - /// Settings properties - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsProperties()); set => this._property = value; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataCreatedByType = value ?? null; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).SystemDataLastModifiedByType = value ?? null; } - - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)Property).TenantId; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceInternal)__proxyResourceAutoGenerated).Type; } - - /// Creates an new instance. - public Settings() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__proxyResourceAutoGenerated), __proxyResourceAutoGenerated); - await eventListener.AssertObjectIsValid(nameof(__proxyResourceAutoGenerated), __proxyResourceAutoGenerated); - } - } - public partial interface ISettings : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGenerated - { - /// Associated Gateway Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Associated Gateway Resource Id", - SerializedName = @"gatewayResourceId", - PossibleTypes = new [] { typeof(string) })] - string GatewayPropertyGatewayResourceId { get; set; } - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Azure resource tenant Id", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string TenantId { get; } - - } - internal partial interface ISettingsInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IProxyResourceAutoGeneratedInternal - { - /// Settings Gateway properties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties GatewayProperty { get; set; } - /// Associated Gateway Resource Id - string GatewayPropertyGatewayResourceId { get; set; } - /// Settings properties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties Property { get; set; } - /// Azure resource tenant Id - string TenantId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.json.cs deleted file mode 100644 index c5916b8ad633..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/Settings.json.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - public partial class Settings - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new Settings(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal Settings(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __proxyResourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ProxyResourceAutoGenerated(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsProperties.FromJson(__jsonProperties) : _property;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __proxyResourceAutoGenerated?.ToJson(container, serializationMode); - AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.TypeConverter.cs deleted file mode 100644 index 6c0622b1b8d3..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class SettingsGatewayPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return SettingsGatewayProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return SettingsGatewayProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return SettingsGatewayProperties.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.cs deleted file mode 100644 index cfb9a13c3022..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Settings Gateway properties - public partial class SettingsGatewayProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayPropertiesInternal - { - - /// Backing field for property. - private string _gatewayResourceId; - - /// Associated Gateway Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string GatewayResourceId { get => this._gatewayResourceId; set => this._gatewayResourceId = value; } - - /// Creates an new instance. - public SettingsGatewayProperties() - { - - } - } - /// Settings Gateway properties - public partial interface ISettingsGatewayProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Associated Gateway Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Associated Gateway Resource Id", - SerializedName = @"gatewayResourceId", - PossibleTypes = new [] { typeof(string) })] - string GatewayResourceId { get; set; } - - } - /// Settings Gateway properties - internal partial interface ISettingsGatewayPropertiesInternal - - { - /// Associated Gateway Resource Id - string GatewayResourceId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.json.cs deleted file mode 100644 index d5f7b0b337bc..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsGatewayProperties.json.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Settings Gateway properties - public partial class SettingsGatewayProperties - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new SettingsGatewayProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal SettingsGatewayProperties(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_gatewayResourceId = If( json?.PropertyT("gatewayResourceId"), out var __jsonGatewayResourceId) ? (string)__jsonGatewayResourceId : (string)_gatewayResourceId;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._gatewayResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._gatewayResourceId.ToString()) : null, "gatewayResourceId" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.PowerShell.cs deleted file mode 100644 index 0edf09ff8dfe..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.PowerShell.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// Settings properties - [System.ComponentModel.TypeConverter(typeof(SettingsPropertiesTypeConverter))] - public partial class SettingsProperties - { - - /// - /// 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.ConnectedMachine.Models.ISettingsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SettingsProperties(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.ConnectedMachine.Models.ISettingsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SettingsProperties(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.ConnectedMachine.Models.ISettingsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SettingsProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("GatewayProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties) content.GetValueForProperty("GatewayProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("GatewayPropertyGatewayResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayPropertyGatewayResourceId = (string) content.GetValueForProperty("GatewayPropertyGatewayResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayPropertyGatewayResourceId, 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 SettingsProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("GatewayProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties) content.GetValueForProperty("GatewayProperty",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayProperty, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("GatewayPropertyGatewayResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayPropertyGatewayResourceId = (string) content.GetValueForProperty("GatewayPropertyGatewayResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal)this).GatewayPropertyGatewayResourceId, 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.ConnectedMachine.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(); - } - } - /// Settings properties - [System.ComponentModel.TypeConverter(typeof(SettingsPropertiesTypeConverter))] - public partial interface ISettingsProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.TypeConverter.cs deleted file mode 100644 index ac424995704d..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class SettingsPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return SettingsProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return SettingsProperties.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return SettingsProperties.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.cs deleted file mode 100644 index 6ddc78db50a0..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Settings properties - public partial class SettingsProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties _gatewayProperty; - - /// Settings Gateway properties - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties GatewayProperty { get => (this._gatewayProperty = this._gatewayProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayProperties()); set => this._gatewayProperty = value; } - - /// Associated Gateway Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inlined)] - public string GatewayPropertyGatewayResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayPropertiesInternal)GatewayProperty).GatewayResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayPropertiesInternal)GatewayProperty).GatewayResourceId = value ?? null; } - - /// Internal Acessors for GatewayProperty - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal.GatewayProperty { get => (this._gatewayProperty = this._gatewayProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayProperties()); set { {_gatewayProperty = value;} } } - - /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsPropertiesInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } - - /// Backing field for property. - private string _tenantId; - - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string TenantId { get => this._tenantId; } - - /// Creates an new instance. - public SettingsProperties() - { - - } - } - /// Settings properties - public partial interface ISettingsProperties : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable - { - /// Associated Gateway Resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Associated Gateway Resource Id", - SerializedName = @"gatewayResourceId", - PossibleTypes = new [] { typeof(string) })] - string GatewayPropertyGatewayResourceId { get; set; } - /// Azure resource tenant Id - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = true, - Read = true, - Create = false, - Update = false, - Description = @"Azure resource tenant Id", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string TenantId { get; } - - } - /// Settings properties - internal partial interface ISettingsPropertiesInternal - - { - /// Settings Gateway properties - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsGatewayProperties GatewayProperty { get; set; } - /// Associated Gateway Resource Id - string GatewayPropertyGatewayResourceId { get; set; } - /// Azure resource tenant Id - string TenantId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.json.cs deleted file mode 100644 index 48b43bf81d26..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/SettingsProperties.json.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// Settings properties - public partial class SettingsProperties - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISettingsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new SettingsProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal SettingsProperties(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_gatewayProperty = If( json?.PropertyT("gatewayProperties"), out var __jsonGatewayProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SettingsGatewayProperties.FromJson(__jsonGatewayProperties) : _gatewayProperty;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} - 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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._gatewayProperty ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._gatewayProperty.ToJson(null,serializationMode) : null, "gatewayProperties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)) - { - AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.PowerShell.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.PowerShell.cs deleted file mode 100644 index 93b8e8468d6f..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.PowerShell.cs +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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(TrackedResourceAutoGeneratedTypeConverter))] - public partial class TrackedResourceAutoGenerated - { - - /// - /// 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.ConnectedMachine.Models.ITrackedResourceAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new TrackedResourceAutoGenerated(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.ConnectedMachine.Models.ITrackedResourceAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new TrackedResourceAutoGenerated(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.ConnectedMachine.Models.ITrackedResourceAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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 TrackedResourceAutoGenerated(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)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 TrackedResourceAutoGenerated(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tags")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) content.GetValueForProperty("Tags",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Tags, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)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(TrackedResourceAutoGeneratedTypeConverter))] - public partial interface ITrackedResourceAutoGenerated - - { - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.TypeConverter.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.TypeConverter.cs deleted file mode 100644 index ed2d0886728e..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.TypeConverter.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class TrackedResourceAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return TrackedResourceAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return TrackedResourceAutoGenerated.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return TrackedResourceAutoGenerated.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/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.cs deleted file mode 100644 index b03428b839e9..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - /// - public partial class TrackedResourceAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGeneratedInternal, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceAutoGenerated(); - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } - - /// Backing field for property. - private string _location; - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public string Location { get => this._location; set => this._location = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - internal Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = value ?? null; } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags _tags; - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tags { get => (this._tags = this._tags ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTags()); set => this._tags = value; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Origin(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; } - - /// Creates an new instance. - public TrackedResourceAutoGenerated() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resourceAutoGenerated), __resourceAutoGenerated); - await eventListener.AssertObjectIsValid(nameof(__resourceAutoGenerated), __resourceAutoGenerated); - } - } - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - public partial interface ITrackedResourceAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGenerated - { - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Read = true, - Create = true, - Update = 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.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Read = true, - Create = true, - Update = true, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tags { get; set; } - - } - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - internal partial interface ITrackedResourceAutoGeneratedInternal : - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceAutoGeneratedInternal - { - /// The geo-location where the resource lives - string Location { get; set; } - /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tags { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.json.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.json.cs deleted file mode 100644 index 0a5af44957e5..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/api/Models/TrackedResourceAutoGenerated.json.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - - /// - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - /// - public partial class TrackedResourceAutoGenerated - { - - /// - /// 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.ConnectedMachine.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.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.ConnectedMachine.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json ? new TrackedResourceAutoGenerated(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.ConnectedMachine.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __resourceAutoGenerated?.ToJson(container, serializationMode); - AddIf( null != this._tags ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) this._tags.ToJson(null,serializationMode) : null, "tags" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate)) - { - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject instance to deserialize from. - internal TrackedResourceAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ResourceAutoGenerated(json); - {_tags = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.TrackedResourceTags.FromJson(__jsonTags) : _tags;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs index d7102e9dc896..8e833fa7d290 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_Get.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionValue))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Gets an Extension Metadata based on location, publisher, extensionType and version")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}", ApiVersion = "2024-07-10")] public partial class GetAzConnectedExtensionMetadata_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs index 2330d10e28bd..524a0f679c36 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedExtensionMetadata_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionValue))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Gets all Extension versions based on location, publisher, extensionType")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions", ApiVersion = "2024-07-10")] public partial class GetAzConnectedExtensionMetadata_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_Get.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_Get.cs index e63d53fda654..41f16e30a1ab 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_Get.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Retrieves information about the view of a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class GetAzConnectedLicense_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List.cs index 4494f6579d5a..378dc55b4d07 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to get all licenses of a non-Azure machine")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses", ApiVersion = "2024-07-10")] public partial class GetAzConnectedLicense_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List1.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List1.cs index 61803490f892..b812c83ef720 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List1.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedLicense_List1.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to get all licenses of a non-Azure machine")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses", ApiVersion = "2024-07-10")] public partial class GetAzConnectedLicense_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs index f4c3a9388aa4..cb8980bc73aa 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to get the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class GetAzConnectedMachineExtension_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs index ef5f8612fd55..c66a4b8ddf51 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineExtension_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to get all extensions of a non-Azure machine")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions", ApiVersion = "2024-07-10")] public partial class GetAzConnectedMachineExtension_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_Get.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_Get.cs deleted file mode 100644 index cc584b55852d..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_Get.cs +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to get a run command. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConnectedMachineRunCommand_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to get a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class GetAzConnectedMachineRunCommand_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = 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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public GetAzConnectedMachineRunCommand_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.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsGet(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_List.cs deleted file mode 100644 index 66830d2c4c4b..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachineRunCommand_List.cs +++ /dev/null @@ -1,552 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to get all the run commands of a non-Azure machine. - /// - /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzConnectedMachineRunCommand_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to get all the run commands of a non-Azure machine.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands", ApiVersion = "2024-05-20-preview")] - public partial class GetAzConnectedMachineRunCommand_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// A flag to tell whether it is the first onOK call. - private bool _isFirst = true; - - /// Link to retrieve next page. - private string _nextLink; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Backing field for property. - private string _expand; - - /// The expand expression to apply on the operation. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The expand expression to apply on the operation.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The expand expression to apply on the operation.", - SerializedName = @"$expand", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Query)] - public string Expand { get => this._expand; set => this._expand = value; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public GetAzConnectedMachineRunCommand_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.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - foreach( var SubscriptionId in this.SubscriptionId ) - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsList(SubscriptionId, ResourceGroupName, MachineName, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommandsListResult - /// 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.ConnectedMachine.Models.IMachineRunCommandsListResult - var result = (await response); - // response should be returning an array of some kind. +Pageable - // pageable / value / nextLink - if (null != result.Value) - { - if (0 == _responseSize && 1 == result.Value.Count) - { - _firstResponse = result.Value[0]; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - var values = new System.Collections.Generic.List(); - foreach( var value in result.Value ) - { - values.Add(value.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(values, true); - _responseSize = 2; - } - } - _nextLink = result.NextLink; - if (_isFirst) - { - _isFirst = false; - while (!String.IsNullOrEmpty(_nextLink)) - { - if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) - { - requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Method.Get ); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsList_Call(requestMessage, onOk, onDefault, this, Pipeline); - } - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs index aa6a0e2157f7..96007de598c6 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_Get.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Retrieves information about the model view or the instance view of a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] public partial class GetAzConnectedMachine_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs index e270c96b42e7..72c448639da7 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Lists all the hybrid machines in the specified resource group. Use the nextLink property in the response to get the next page of hybrid machines.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines", ApiVersion = "2024-07-10")] public partial class GetAzConnectedMachine_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs index 2436f63155aa..08dc01beaf22 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedMachine_List1.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines", ApiVersion = "2024-07-10")] public partial class GetAzConnectedMachine_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_Get.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_Get.cs index e92eec229a6d..3153720ff930 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_Get.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Gets the network security perimeter configuration for a private link scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}", ApiVersion = "2024-07-10")] public partial class GetAzConnectedNetworkSecurityPerimeterConfiguration_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_List.cs index d1f345acd872..4a7b73bffb0f 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_List.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedNetworkSecurityPerimeterConfiguration_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Lists the network security perimeter configurations for a private link scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations", ApiVersion = "2024-07-10")] public partial class GetAzConnectedNetworkSecurityPerimeterConfiguration_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs index 45985cc3f58b..4aa9aacc6284 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedOperation_List.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IOperationValue))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Gets a list of hybrid compute operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/providers/Microsoft.HybridCompute/operations", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/providers/Microsoft.HybridCompute/operations", ApiVersion = "2024-07-10")] public partial class GetAzConnectedOperation_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs index a0b779511ab1..b9903e8e95e0 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_Get.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Returns a Azure Arc PrivateLinkScope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class GetAzConnectedPrivateLinkScope_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs index f1b5e1fea7d3..85a9ad9082f8 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Gets a list of all Azure Arc PrivateLinkScopes within a subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/privateLinkScopes", ApiVersion = "2024-07-10")] public partial class GetAzConnectedPrivateLinkScope_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs index e47cd9b1898c..42e47240399e 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/GetAzConnectedPrivateLinkScope_List1.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Gets a list of Azure Arc PrivateLinkScopes within a resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes", ApiVersion = "2024-07-10")] public partial class GetAzConnectedPrivateLinkScope_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_Install.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_Install.cs index 8c3922cafcd6..1a26dc1c6443 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_Install.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_Install.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to install patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-07-10")] public partial class InstallAzConnectedMachinePatch_Install : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs index f05f258363f5..eaf9b27a06d0 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to install patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-07-10")] public partial class InstallAzConnectedMachinePatch_InstallExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentity.cs index d9477a392cd2..1f8ee22b588c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to install patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-07-10")] public partial class InstallAzConnectedMachinePatch_InstallViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs index a3ae137b0da1..371113ddabd3 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to install patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-07-10")] public partial class InstallAzConnectedMachinePatch_InstallViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonFilePath.cs index f80a573ac029..3c4a457a9235 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to install patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class InstallAzConnectedMachinePatch_InstallViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonString.cs index 2615d5023be1..46c63dd32a8d 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InstallAzConnectedMachinePatch_InstallViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to install patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class InstallAzConnectedMachinePatch_InstallViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs index 253239c8f363..ec1dfb46bc5a 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_Assess.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineAssessPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to assess patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches", ApiVersion = "2024-07-10")] public partial class InvokeAzConnectedAssessMachinePatch_Assess : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs index 907b82bbd9ca..3f66bb441c90 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedAssessMachinePatch_AssessViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineAssessPatchesResult))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to assess patches on a hybrid machine identity in Azure.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches", ApiVersion = "2024-07-10")] public partial class InvokeAzConnectedAssessMachinePatch_AssessViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile.cs similarity index 90% rename from generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonString.cs rename to generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile.cs index 2b2c7c1477e9..922c2e6c301e 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile.cs @@ -10,17 +10,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; using System; - /// The operation to create a run command. + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" + /// [OpenAPI] ReconcileForPrivateLinkScope=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_CreateViaJsonString", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Forces the network security perimeter configuration to refresh for a private link scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] - public partial class NewAzConnectedMachineRunCommand_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile", ApiVersion = "2024-07-10")] + public partial class InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext { @@ -94,33 +95,6 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaJsonString : globa /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - /// Backing field for property. - private string _jsonString; - - /// Json string supplied to the Create operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Json string supplied to the Create operation", - SerializedName = @"JsonString", - PossibleTypes = new [] { typeof(string) })] - public string JsonString { get => this._jsonString; set => this._jsonString = value; } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -137,6 +111,22 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaJsonString : globa [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + /// Backing field for property. + private string _perimeterName; + + /// + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource.", + SerializedName = @"perimeterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] + public string PerimeterName { get => this._perimeterName; set => this._perimeterName = value; } + /// /// The instance of the that the remote call will use. /// @@ -176,19 +166,19 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaJsonString : globa [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - /// Backing field for property. - private string _runCommandName; + /// Backing field for property. + private string _scopeName; - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] + /// The name of the Azure Arc PrivateLinkScope resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure Arc PrivateLinkScope resource.")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( Required = true, ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", + Description = @"The name of the Azure Arc PrivateLinkScope resource.", + SerializedName = @"scopeName", PossibleTypes = new [] { typeof(string) })] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } + public string ScopeName { get => this._scopeName; set => this._scopeName = value; } /// Backing field for property. private string _subscriptionId; @@ -226,12 +216,12 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaJsonString : globa /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -252,10 +242,12 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzConnectedMachineRunCommand_CreateViaJsonString - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_CreateViaJsonString Clone() + /// + /// a duplicate instance of InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile + /// + public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile Clone() { - var clone = new NewAzConnectedMachineRunCommand_CreateViaJsonString(); + var clone = new InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -270,9 +262,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnecte clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; - clone.MachineName = this.MachineName; - clone.RunCommandName = this.RunCommandName; - clone.JsonString = this.JsonString; + clone.ScopeName = this.ScopeName; + clone.PerimeterName = this.PerimeterName; return clone; } @@ -304,6 +295,15 @@ protected override void EndProcessing() } } + /// + /// Initializes a new instance of the cmdlet class. + /// + public InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_Reconcile() + { + + } + /// 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 @@ -417,14 +417,6 @@ protected override void EndProcessing() } } - /// - /// Initializes a new instance of the cmdlet class. - /// - public NewAzConnectedMachineRunCommand_CreateViaJsonString() - { - - } - /// Performs execution of the command. protected override void ProcessRecord() { @@ -433,7 +425,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) + if (ShouldProcess($"Call remote 'NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -497,12 +489,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, _jsonString, onOk, onDefault, this, Pipeline); + await this.Client.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope(SubscriptionId, ResourceGroupName, ScopeName, PerimeterName, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ScopeName=ScopeName,PerimeterName=PerimeterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -580,12 +572,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -597,7 +589,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult var result = (await response); if (null != result) { diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity.cs similarity index 90% rename from generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentity.cs rename to generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity.cs index 73193b62eef3..64d4480dd33c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity.cs @@ -10,16 +10,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; using System; - /// The operation to create a run command. + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" + /// [OpenAPI] ReconcileForPrivateLinkScope=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_CreateViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Forces the network security perimeter configuration to refresh for a private link scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class NewAzConnectedMachineRunCommand_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile", ApiVersion = "2024-07-10")] + public partial class InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext { @@ -138,20 +140,6 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandProperty; - - /// Describes a Run Command - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes a Run Command", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Describes a Run Command", - SerializedName = @"runCommandProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand RunCommandProperty { get => this._runCommandProperty; set => this._runCommandProperty = 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 @@ -169,12 +157,12 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaIdentity : global: /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -195,10 +183,12 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzConnectedMachineRunCommand_CreateViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_CreateViaIdentity Clone() + /// + /// a duplicate instance of InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity Clone() { - var clone = new NewAzConnectedMachineRunCommand_CreateViaIdentity(); + var clone = new InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -211,7 +201,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnecte clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.RunCommandProperty = this.RunCommandProperty; return clone; } @@ -243,6 +232,15 @@ protected override void EndProcessing() } } + /// + /// Initializes a new instance of the cmdlet class. + /// + public InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentity() + { + + } + /// 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 @@ -356,14 +354,6 @@ protected override void EndProcessing() } } - /// - /// Initializes a new instance of the cmdlet class. - /// - public NewAzConnectedMachineRunCommand_CreateViaIdentity() - { - - } - /// Performs execution of the command. protected override void ProcessRecord() { @@ -372,7 +362,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) + if (ShouldProcess($"Call remote 'NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -438,7 +428,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(InputObject.Id, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); + await this.Client.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); } else { @@ -451,15 +441,15 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - if (null == InputObject.MachineName) + if (null == InputObject.ScopeName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ScopeName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - if (null == InputObject.RunCommandName) + if (null == InputObject.PerimeterName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RunCommandName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PerimeterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.MachineRunCommandsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MachineName ?? null, InputObject.RunCommandName ?? null, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); + await this.Client.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ScopeName ?? null, InputObject.PerimeterName ?? null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } @@ -543,12 +533,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -560,7 +550,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult var result = (await response); if (null != result) { diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachine.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope.cs similarity index 86% rename from generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachine.cs rename to generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope.cs index f96125d30b8f..552d2a6ae637 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachine.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope.cs @@ -10,16 +10,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; using System; - /// The operation to create a run command. + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" + /// [OpenAPI] ReconcileForPrivateLinkScope=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_CreateViaIdentityMachine", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Forces the network security perimeter configuration to refresh for a private link scope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class NewAzConnectedMachineRunCommand_CreateViaIdentityMachine : global::System.Management.Automation.PSCmdlet, + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile", ApiVersion = "2024-07-10")] + public partial class InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext { @@ -93,14 +95,6 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaIdentityMachine : /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _machineInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity MachineInputObject { get => this._machineInputObject; set => this._machineInputObject = value; } - /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -117,11 +111,35 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaIdentityMachine : [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + /// Backing field for property. + private string _perimeterName; + + /// + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource.", + SerializedName = @"perimeterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] + public string PerimeterName { get => this._perimeterName; set => this._perimeterName = value; } + /// /// The instance of the that the remote call will use. /// public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.HttpPipeline Pipeline { get; set; } + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _privateLinkScopeInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity PrivateLinkScopeInputObject { get => this._privateLinkScopeInputObject; set => this._privateLinkScopeInputObject = value; } + /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] @@ -138,34 +156,6 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaIdentityMachine : [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandProperty; - - /// Describes a Run Command - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes a Run Command", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Describes a Run Command", - SerializedName = @"runCommandProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand RunCommandProperty { get => this._runCommandProperty; set => this._runCommandProperty = 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 @@ -183,12 +173,12 @@ public partial class NewAzConnectedMachineRunCommand_CreateViaIdentityMachine : /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -210,11 +200,11 @@ protected override void BeginProcessing() /// Creates a duplicate instance of this cmdlet (via JSON serialization). /// - /// a duplicate instance of NewAzConnectedMachineRunCommand_CreateViaIdentityMachine + /// a duplicate instance of InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_CreateViaIdentityMachine Clone() + public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope Clone() { - var clone = new NewAzConnectedMachineRunCommand_CreateViaIdentityMachine(); + var clone = new InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -227,8 +217,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnecte clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.RunCommandName = this.RunCommandName; - clone.RunCommandProperty = this.RunCommandProperty; + clone.PerimeterName = this.PerimeterName; return clone; } @@ -260,6 +249,15 @@ protected override void EndProcessing() } } + /// + /// Initializes a new instance of the cmdlet class. + /// + public InvokeAzConnectedReconcileNetworkSecurityPerimeterConfiguration_ReconcileViaIdentityPrivateLinkScope() + { + + } + /// 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 @@ -373,14 +371,6 @@ protected override void EndProcessing() } } - /// - /// Initializes a new instance of the cmdlet class. - /// - public NewAzConnectedMachineRunCommand_CreateViaIdentityMachine() - { - - } - /// Performs execution of the command. protected override void ProcessRecord() { @@ -389,7 +379,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) + if (ShouldProcess($"Call remote 'NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -453,33 +443,33 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (MachineInputObject?.Id != null) + if (PrivateLinkScopeInputObject?.Id != null) { - this.MachineInputObject.Id += $"/runCommands/{(global::System.Uri.EscapeDataString(this.RunCommandName.ToString()))}"; - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(MachineInputObject.Id, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); + this.PrivateLinkScopeInputObject.Id += $"/networkSecurityPerimeterConfigurations/{(global::System.Uri.EscapeDataString(this.PerimeterName.ToString()))}"; + await this.Client.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScopeViaIdentity(PrivateLinkScopeInputObject.Id, onOk, onDefault, this, Pipeline); } else { // try to call with PATH parameters from Input Object - if (null == MachineInputObject.SubscriptionId) + if (null == PrivateLinkScopeInputObject.SubscriptionId) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateLinkScopeInputObject has null value for PrivateLinkScopeInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateLinkScopeInputObject) ); } - if (null == MachineInputObject.ResourceGroupName) + if (null == PrivateLinkScopeInputObject.ResourceGroupName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateLinkScopeInputObject has null value for PrivateLinkScopeInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateLinkScopeInputObject) ); } - if (null == MachineInputObject.MachineName) + if (null == PrivateLinkScopeInputObject.ScopeName) { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateLinkScopeInputObject has null value for PrivateLinkScopeInputObject.ScopeName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateLinkScopeInputObject) ); } - await this.Client.MachineRunCommandsCreateOrUpdate(MachineInputObject.SubscriptionId ?? null, MachineInputObject.ResourceGroupName ?? null, MachineInputObject.MachineName ?? null, RunCommandName, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); + await this.Client.NetworkSecurityPerimeterConfigurationsReconcileForPrivateLinkScope(PrivateLinkScopeInputObject.SubscriptionId ?? null, PrivateLinkScopeInputObject.ResourceGroupName ?? null, PrivateLinkScopeInputObject.ScopeName ?? null, PerimeterName, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RunCommandName=RunCommandName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PerimeterName=PerimeterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -557,12 +547,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -574,7 +564,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.INetworkSecurityPerimeterConfigurationReconcileResult var result = (await response); if (null != result) { diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_Create.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_Create.cs index 5f5e15aea752..f257cd6ebbf9 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_Create.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_Create.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedLicense_Create : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateExpanded.cs index f5b5214b4edc..e0951aa53032 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedLicense_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentity.cs index c5cdb1f4f7a6..554fa8b8fe6c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedLicense_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentityExpanded.cs index a94f20cd4267..adc3bcdcacea 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedLicense_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonFilePath.cs index 579484e3df51..85ce9836d15d 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class NewAzConnectedLicense_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonString.cs index 0a0ea3bb0210..f8c9b35be650 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedLicense_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class NewAzConnectedLicense_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs index f9ebbf1191b1..fd3dcbb3cded 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_Create.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedMachineExtension_Create : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs index 32d137347dbf..3c3c5b191ff7 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedMachineExtension_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs index 3e9b84f67fc7..1de726ae8175 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedMachineExtension_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs index 3e9b17b20a0f..d72e2e2dc046 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedMachineExtension_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs index dcef94687835..9fa493b87f4c 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachine.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedMachineExtension_CreateViaIdentityMachine : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs index 08fca69321df..0e9918347aff 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedMachineExtension_CreateViaIdentityMachineExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs index 115ca3388eaa..d0a7965ff721 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class NewAzConnectedMachineExtension_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs index 10c1fc816b95..1c0042411c0b 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineExtension_CreateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class NewAzConnectedMachineExtension_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_Create.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_Create.cs deleted file mode 100644 index 3d37f4e266c4..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_Create.cs +++ /dev/null @@ -1,623 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to create a run command. - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_Create", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class NewAzConnectedMachineRunCommand_Create : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandProperty; - - /// Describes a Run Command - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes a Run Command", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Describes a Run Command", - SerializedName = @"runCommandProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand RunCommandProperty { get => this._runCommandProperty; set => this._runCommandProperty = 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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzConnectedMachineRunCommand_Create - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_Create Clone() - { - var clone = new NewAzConnectedMachineRunCommand_Create(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.MachineName = this.MachineName; - clone.RunCommandName = this.RunCommandName; - clone.RunCommandProperty = this.RunCommandProperty; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); - if (token.IsCancellationRequested) - { - return ; - } - WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public NewAzConnectedMachineRunCommand_Create() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsCreateOrUpdate(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateExpanded.cs deleted file mode 100644 index 8951c9e0c876..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateExpanded.cs +++ /dev/null @@ -1,852 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to create a run command. - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class NewAzConnectedMachineRunCommand_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Describes a Run Command - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand(); - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter AsyncExecution { get => _runCommandPropertiesBody.AsyncExecution ?? default(global::System.Management.Automation.SwitchParameter); set => _runCommandPropertiesBody.AsyncExecution = value; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityClientId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobUri { get => _runCommandPropertiesBody.ErrorBlobUri ?? null; set => _runCommandPropertiesBody.ErrorBlobUri = value; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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; } } - - /// The geo-location where the resource lives - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The geo-location where the resource lives", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"Location Completer", - Description =@"Gets the list of locations available for this resource.", - Script = @"Get-AzLocation | Where-Object Providers -Contains ""Microsoft.HybridCompute"" | Select-Object -ExpandProperty Location")] - public string Location { get => _runCommandPropertiesBody.Location ?? null; set => _runCommandPropertiesBody.Location = value; } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityClientId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobUri { get => _runCommandPropertiesBody.OutputBlobUri ?? null; set => _runCommandPropertiesBody.OutputBlobUri = value; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] Parameter { get => _runCommandPropertiesBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.HttpPipeline Pipeline { get; set; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] ProtectedParameter { get => _runCommandPropertiesBody.ProtectedParameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.ProtectedParameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// 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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account password on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - public string RunAsPassword { get => _runCommandPropertiesBody.RunAsPassword ?? null; set => _runCommandPropertiesBody.RunAsPassword = value; } - - /// Specifies the user account on the machine when executing the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - public string RunAsUser { get => _runCommandPropertiesBody.RunAsUser ?? null; set => _runCommandPropertiesBody.RunAsUser = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityClientId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityObjectId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId = value; } - - /// Specifies the commandId of predefined built-in script. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the commandId of predefined built-in script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - public string SourceCommandId { get => _runCommandPropertiesBody.SourceCommandId ?? null; set => _runCommandPropertiesBody.SourceCommandId = value; } - - /// Specifies the script content to be executed on the machine. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script content to be executed on the machine.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - public string SourceScript { get => _runCommandPropertiesBody.SourceScript ?? null; set => _runCommandPropertiesBody.SourceScript = value; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - public string SourceScriptUri { get => _runCommandPropertiesBody.SourceScriptUri ?? null; set => _runCommandPropertiesBody.SourceScriptUri = 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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tag { get => _runCommandPropertiesBody.Tags ?? null /* object */; set => _runCommandPropertiesBody.Tags = value; } - - /// The timeout in seconds to execute the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The timeout in seconds to execute the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - public int TimeoutInSecond { get => _runCommandPropertiesBody.TimeoutInSecond ?? default(int); set => _runCommandPropertiesBody.TimeoutInSecond = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzConnectedMachineRunCommand_CreateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_CreateExpanded Clone() - { - var clone = new NewAzConnectedMachineRunCommand_CreateExpanded(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._runCommandPropertiesBody = this._runCommandPropertiesBody; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.MachineName = this.MachineName; - clone.RunCommandName = this.RunCommandName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); - if (token.IsCancellationRequested) - { - return ; - } - WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public NewAzConnectedMachineRunCommand_CreateExpanded() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsCreateOrUpdate(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded.cs deleted file mode 100644 index d1e27737b255..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded.cs +++ /dev/null @@ -1,817 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to create a run command. - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_CreateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Describes a Run Command - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand(); - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter AsyncExecution { get => _runCommandPropertiesBody.AsyncExecution ?? default(global::System.Management.Automation.SwitchParameter); set => _runCommandPropertiesBody.AsyncExecution = value; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityClientId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobUri { get => _runCommandPropertiesBody.ErrorBlobUri ?? null; set => _runCommandPropertiesBody.ErrorBlobUri = value; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// The geo-location where the resource lives - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The geo-location where the resource lives", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"Location Completer", - Description =@"Gets the list of locations available for this resource.", - Script = @"Get-AzLocation | Where-Object Providers -Contains ""Microsoft.HybridCompute"" | Select-Object -ExpandProperty Location")] - public string Location { get => _runCommandPropertiesBody.Location ?? null; set => _runCommandPropertiesBody.Location = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityClientId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobUri { get => _runCommandPropertiesBody.OutputBlobUri ?? null; set => _runCommandPropertiesBody.OutputBlobUri = value; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] Parameter { get => _runCommandPropertiesBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.HttpPipeline Pipeline { get; set; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] ProtectedParameter { get => _runCommandPropertiesBody.ProtectedParameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.ProtectedParameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// 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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account password on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - public string RunAsPassword { get => _runCommandPropertiesBody.RunAsPassword ?? null; set => _runCommandPropertiesBody.RunAsPassword = value; } - - /// Specifies the user account on the machine when executing the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - public string RunAsUser { get => _runCommandPropertiesBody.RunAsUser ?? null; set => _runCommandPropertiesBody.RunAsUser = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityClientId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityObjectId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId = value; } - - /// Specifies the commandId of predefined built-in script. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the commandId of predefined built-in script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - public string SourceCommandId { get => _runCommandPropertiesBody.SourceCommandId ?? null; set => _runCommandPropertiesBody.SourceCommandId = value; } - - /// Specifies the script content to be executed on the machine. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script content to be executed on the machine.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - public string SourceScript { get => _runCommandPropertiesBody.SourceScript ?? null; set => _runCommandPropertiesBody.SourceScript = value; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - public string SourceScriptUri { get => _runCommandPropertiesBody.SourceScriptUri ?? null; set => _runCommandPropertiesBody.SourceScriptUri = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tag { get => _runCommandPropertiesBody.Tags ?? null /* object */; set => _runCommandPropertiesBody.Tags = value; } - - /// The timeout in seconds to execute the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The timeout in seconds to execute the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - public int TimeoutInSecond { get => _runCommandPropertiesBody.TimeoutInSecond ?? default(int); set => _runCommandPropertiesBody.TimeoutInSecond = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded Clone() - { - var clone = new NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._runCommandPropertiesBody = this._runCommandPropertiesBody; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); - if (token.IsCancellationRequested) - { - return ; - } - WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public NewAzConnectedMachineRunCommand_CreateViaIdentityExpanded() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(InputObject.Id, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.RunCommandName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RunCommandName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.MachineRunCommandsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MachineName ?? null, InputObject.RunCommandName ?? null, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded.cs deleted file mode 100644 index 0e16219b84ae..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded.cs +++ /dev/null @@ -1,830 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to create a run command. - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Describes a Run Command - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand(); - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter AsyncExecution { get => _runCommandPropertiesBody.AsyncExecution ?? default(global::System.Management.Automation.SwitchParameter); set => _runCommandPropertiesBody.AsyncExecution = value; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityClientId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobUri { get => _runCommandPropertiesBody.ErrorBlobUri ?? null; set => _runCommandPropertiesBody.ErrorBlobUri = value; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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; } } - - /// The geo-location where the resource lives - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The geo-location where the resource lives", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"Location Completer", - Description =@"Gets the list of locations available for this resource.", - Script = @"Get-AzLocation | Where-Object Providers -Contains ""Microsoft.HybridCompute"" | Select-Object -ExpandProperty Location")] - public string Location { get => _runCommandPropertiesBody.Location ?? null; set => _runCommandPropertiesBody.Location = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _machineInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity MachineInputObject { get => this._machineInputObject; set => this._machineInputObject = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityClientId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobUri { get => _runCommandPropertiesBody.OutputBlobUri ?? null; set => _runCommandPropertiesBody.OutputBlobUri = value; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] Parameter { get => _runCommandPropertiesBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.HttpPipeline Pipeline { get; set; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] ProtectedParameter { get => _runCommandPropertiesBody.ProtectedParameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.ProtectedParameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// 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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account password on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - public string RunAsPassword { get => _runCommandPropertiesBody.RunAsPassword ?? null; set => _runCommandPropertiesBody.RunAsPassword = value; } - - /// Specifies the user account on the machine when executing the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - public string RunAsUser { get => _runCommandPropertiesBody.RunAsUser ?? null; set => _runCommandPropertiesBody.RunAsUser = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityClientId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityObjectId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId = value; } - - /// Specifies the commandId of predefined built-in script. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the commandId of predefined built-in script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - public string SourceCommandId { get => _runCommandPropertiesBody.SourceCommandId ?? null; set => _runCommandPropertiesBody.SourceCommandId = value; } - - /// Specifies the script content to be executed on the machine. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script content to be executed on the machine.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - public string SourceScript { get => _runCommandPropertiesBody.SourceScript ?? null; set => _runCommandPropertiesBody.SourceScript = value; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - public string SourceScriptUri { get => _runCommandPropertiesBody.SourceScriptUri ?? null; set => _runCommandPropertiesBody.SourceScriptUri = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tag { get => _runCommandPropertiesBody.Tags ?? null /* object */; set => _runCommandPropertiesBody.Tags = value; } - - /// The timeout in seconds to execute the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The timeout in seconds to execute the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - public int TimeoutInSecond { get => _runCommandPropertiesBody.TimeoutInSecond ?? default(int); set => _runCommandPropertiesBody.TimeoutInSecond = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded Clone() - { - var clone = new NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._runCommandPropertiesBody = this._runCommandPropertiesBody; - clone.RunCommandName = this.RunCommandName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); - if (token.IsCancellationRequested) - { - return ; - } - WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); - } - } - - /// - /// Initializes a new instance of the cmdlet - /// class. - /// - public NewAzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (MachineInputObject?.Id != null) - { - this.MachineInputObject.Id += $"/runCommands/{(global::System.Uri.EscapeDataString(this.RunCommandName.ToString()))}"; - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(MachineInputObject.Id, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); - } - else - { - // try to call with PATH parameters from Input Object - if (null == MachineInputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - await this.Client.MachineRunCommandsCreateOrUpdate(MachineInputObject.SubscriptionId ?? null, MachineInputObject.ResourceGroupName ?? null, MachineInputObject.MachineName ?? null, RunCommandName, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonFilePath.cs deleted file mode 100644 index 9032a209bae3..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedMachineRunCommand_CreateViaJsonFilePath.cs +++ /dev/null @@ -1,625 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to create a run command. - /// - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzConnectedMachineRunCommand_CreateViaJsonFilePath", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to create a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] - public partial class NewAzConnectedMachineRunCommand_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - public global::System.String _jsonString; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _jsonFilePath; - - /// Path of Json file supplied to the Create operation - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Path of Json file supplied to the Create operation", - SerializedName = @"JsonFilePath", - PossibleTypes = new [] { typeof(string) })] - public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = 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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzConnectedMachineRunCommand_CreateViaJsonFilePath - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.NewAzConnectedMachineRunCommand_CreateViaJsonFilePath Clone() - { - var clone = new NewAzConnectedMachineRunCommand_CreateViaJsonFilePath(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.MachineName = this.MachineName; - clone.RunCommandName = this.RunCommandName; - clone.JsonFilePath = this.JsonFilePath; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); - if (token.IsCancellationRequested) - { - return ; - } - WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public NewAzConnectedMachineRunCommand_CreateViaJsonFilePath() - { - - } - - /// Performs execution of the command. - protected override void ProcessRecord() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, _jsonString, onOk, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs index 4c5f4e04bc05..ca27f52e320d 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_Create.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"create (or create a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedPrivateLinkScope_Create : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs index 89b6620aa450..6c611b76c06b 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateExpanded.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"create (or create a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedPrivateLinkScope_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs index e90a26a66532..5f2bb5b8ce35 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentity.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"create (or create a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedPrivateLinkScope_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs index a076077176c4..ae3fb0853d0a 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"create (or create a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class NewAzConnectedPrivateLinkScope_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs index 0b06a20785c0..739a03c52212 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"create (or create a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class NewAzConnectedPrivateLinkScope_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs index f826ea000098..db6717b50fc2 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/NewAzConnectedPrivateLinkScope_CreateViaJsonString.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"create (or create a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class NewAzConnectedPrivateLinkScope_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_Delete.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_Delete.cs index 15236b8810a2..01495d714802 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_Delete.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedLicense_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_DeleteViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_DeleteViaIdentity.cs index 4538a6a43d1f..a56973843d2e 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_DeleteViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedLicense_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedLicense_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs index d082b73de09a..1a6a8e0851fb 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedMachineExtension_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs index bf17e8d79666..d13588aa5391 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedMachineExtension_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs index 7584450c0553..aad7ce9d0f3d 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedMachineExtension_DeleteViaIdentityMachine : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_Delete.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_Delete.cs deleted file mode 100644 index 5fde040377a9..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_Delete.cs +++ /dev/null @@ -1,629 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to delete a run command. - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzConnectedMachineRunCommand_Delete", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class RemoveAzConnectedMachineRunCommand_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter PassThru { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = 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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of - /// what happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onNoContent method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzConnectedMachineRunCommand_Delete - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.RemoveAzConnectedMachineRunCommand_Delete Clone() - { - var clone = new RemoveAzConnectedMachineRunCommand_Delete(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.MachineName = this.MachineName; - clone.RunCommandName = this.RunCommandName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MachineRunCommandsDelete(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, onOk, onNoContent, onDefault, this, Pipeline); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzConnectedMachineRunCommand_Delete() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 204 (NoContent). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnNoContent(responseMessage, ref _returnNow); - // if overrideOnNoContent has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentity.cs deleted file mode 100644 index de3d95ca4731..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentity.cs +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to delete a run command. - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzConnectedMachineRunCommand_DeleteViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class RemoveAzConnectedMachineRunCommand_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter PassThru { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of - /// what happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onNoContent method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of RemoveAzConnectedMachineRunCommand_DeleteViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.RemoveAzConnectedMachineRunCommand_DeleteViaIdentity Clone() - { - var clone = new RemoveAzConnectedMachineRunCommand_DeleteViaIdentity(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.MachineRunCommandsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.RunCommandName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RunCommandName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.MachineRunCommandsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MachineName ?? null, InputObject.RunCommandName ?? null, onOk, onNoContent, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzConnectedMachineRunCommand_DeleteViaIdentity() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 204 (NoContent). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnNoContent(responseMessage, ref _returnNow); - // if overrideOnNoContent has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine.cs deleted file mode 100644 index 5b8a93133aac..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine.cs +++ /dev/null @@ -1,606 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to delete a run command. - /// - /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzConnectedMachineRunCommand_DeleteViaIdentityMachine", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}", ApiVersion = "2024-05-20-preview")] - public partial class RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _machineInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity MachineInputObject { get => this._machineInputObject; set => this._machineInputObject = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter PassThru { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of - /// what happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onNoContent method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine Clone() - { - var clone = new RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.RunCommandName = this.RunCommandName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsDelete' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (MachineInputObject?.Id != null) - { - this.MachineInputObject.Id += $"/runCommands/{(global::System.Uri.EscapeDataString(this.RunCommandName.ToString()))}"; - await this.Client.MachineRunCommandsDeleteViaIdentity(MachineInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == MachineInputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - await this.Client.MachineRunCommandsDelete(MachineInputObject.SubscriptionId ?? null, MachineInputObject.ResourceGroupName ?? null, MachineInputObject.MachineName ?? null, RunCommandName, onOk, onNoContent, onDefault, this, Pipeline); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public RemoveAzConnectedMachineRunCommand_DeleteViaIdentityMachine() - { - - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 204 (NoContent). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnNoContent(responseMessage, ref _returnNow); - // if overrideOnNoContent has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnOk(responseMessage, ref _returnNow); - // if overrideOnOk has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) - { - WriteObject(true); - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs index 59f665499a51..ce7e2cd120f4 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedMachine_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs index 6cb25096d91b..4a43e803b667 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedMachine_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to delete a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedMachine_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs index eb20ec9b32d3..ce1c866464c8 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_Delete.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Deletes a Azure Arc PrivateLinkScope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedPrivateLinkScope_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs index 8ad4c0727a47..14c204b29a70 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"Deletes a Azure Arc PrivateLinkScope.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class RemoveAzConnectedPrivateLinkScope_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_Update.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_Update.cs index b3c4a879f7eb..b755a712bb1b 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_Update.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_Update.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class SetAzConnectedLicense_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateExpanded.cs index 061fc8af8aed..91e500f4e8d7 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] public partial class SetAzConnectedLicense_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonFilePath.cs index 0d29b1f5d7e4..69f89def91e4 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class SetAzConnectedLicense_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonString.cs index 4a12f428c8d4..392a46726dbc 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedLicense_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ILicense))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a license.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/licenses/{licenseName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class SetAzConnectedLicense_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs index a8139f25296c..89d94ea41239 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_Update.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class SetAzConnectedMachineExtension_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs index 49d4b58bf463..9c5154628228 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class SetAzConnectedMachineExtension_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs index dc0e45715025..538133b32180 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class SetAzConnectedMachineExtension_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs index 95b581361fea..33ff36030b83 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedMachineExtension_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class SetAzConnectedMachineExtension_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs index 0f0a1c06323d..73657d4a1ec3 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_Update.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class SetAzConnectedPrivateLinkScope_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs index c406172241df..13f504211635 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateExpanded.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class SetAzConnectedPrivateLinkScope_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs index 8a94835e664d..f0ca4b377e6e 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class SetAzConnectedPrivateLinkScope_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs index fcfef8212778..3c5d3b466c21 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/SetAzConnectedPrivateLinkScope_UpdateViaJsonString.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update (or update a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class SetAzConnectedPrivateLinkScope_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs index eb495abcc177..21be9d21f870 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to Upgrade Machine Extensions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedExtension_UpgradeExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs index ad78d8c18005..a71e836e67ed 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to Upgrade Machine Extensions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedExtension_UpgradeViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs index c9e8d7547ae2..b1b87c3de715 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to Upgrade Machine Extensions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedExtension_UpgradeViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs index 42d0c36b0554..74511eac6565 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to Upgrade Machine Extensions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedExtension_UpgradeViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs index 0ad055f7bf20..52fc49f26390 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedExtension_UpgradeViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to Upgrade Machine Extensions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/upgradeExtensions", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedExtension_UpgradeViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs index 61837cf57df3..147d98500b56 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_Update.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachineExtension_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs index 6c112e8cbfc0..f45b866a85be 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachineExtension_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs index e83c6f453add..2d7b24f36cb0 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentity.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachineExtension_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs index 9b85820bd466..932dea8f5e62 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachineExtension_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs index 67b274d050d3..f20c7e7c5560 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachineExtension_UpdateViaIdentityMachine : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs index 441f3c9d9985..cd0d5f05c589 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachineExtension_UpdateViaIdentityMachineExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs index e049e89570aa..46a3f94c38bf 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedMachineExtension_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs index 07ef5651fc6e..692f18831163 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineExtension_UpdateViaJsonString.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update the extension.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/extensions/{extensionName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedMachineExtension_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_Update.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_Update.cs deleted file mode 100644 index fee1e98b04b2..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_Update.cs +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to update a run command. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConnectedMachineRunCommand_Update", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - public partial class UpdateAzConnectedMachineRunCommand_Update : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandProperty; - - /// Describes a Run Command - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes a Run Command", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Describes a Run Command", - SerializedName = @"runCommandProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand RunCommandProperty { get => this._runCommandProperty; set => this._runCommandProperty = 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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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 Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzConnectedMachineRunCommand_Update - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.UpdateAzConnectedMachineRunCommand_Update Clone() - { - var clone = new UpdateAzConnectedMachineRunCommand_Update(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.MachineName = this.MachineName; - clone.RunCommandName = this.RunCommandName; - clone.RunCommandProperty = this.RunCommandProperty; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - RunCommandProperty = await this.Client.MachineRunCommandsGetWithResult(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, this, Pipeline); - this.UpdateRunCommandProperty(); - await this.Client.MachineRunCommandsCreateOrUpdate(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzConnectedMachineRunCommand_Update() - { - - } - - private void UpdateRunCommandProperty() - { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunCommandProperty"))) - { - this.RunCommandProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand)(this.MyInvocation?.BoundParameters["RunCommandProperty"]); - } - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateExpanded.cs deleted file mode 100644 index 98b7580e7d35..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateExpanded.cs +++ /dev/null @@ -1,915 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to update a run command. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConnectedMachineRunCommand_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - public partial class UpdateAzConnectedMachineRunCommand_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Describes a Run Command - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand(); - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter AsyncExecution { get => _runCommandPropertiesBody.AsyncExecution ?? default(global::System.Management.Automation.SwitchParameter); set => _runCommandPropertiesBody.AsyncExecution = value; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityClientId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobUri { get => _runCommandPropertiesBody.ErrorBlobUri ?? null; set => _runCommandPropertiesBody.ErrorBlobUri = value; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private string _machineName; - - /// The name of the hybrid machine. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the hybrid machine.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the hybrid machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityClientId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobUri { get => _runCommandPropertiesBody.OutputBlobUri ?? null; set => _runCommandPropertiesBody.OutputBlobUri = value; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] Parameter { get => _runCommandPropertiesBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.HttpPipeline Pipeline { get; set; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] ProtectedParameter { get => _runCommandPropertiesBody.ProtectedParameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.ProtectedParameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// 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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the resource group. The name is case insensitive.", - SerializedName = @"resourceGroupName", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.CompleterInfo( - Name = @"ResourceGroupName Completer", - Description =@"Gets the list of ResourceGroupName's available for this subscription.", - Script = @"Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account password on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - public string RunAsPassword { get => _runCommandPropertiesBody.RunAsPassword ?? null; set => _runCommandPropertiesBody.RunAsPassword = value; } - - /// Specifies the user account on the machine when executing the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - public string RunAsUser { get => _runCommandPropertiesBody.RunAsUser ?? null; set => _runCommandPropertiesBody.RunAsUser = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityClientId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityObjectId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId = value; } - - /// Specifies the commandId of predefined built-in script. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the commandId of predefined built-in script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - public string SourceCommandId { get => _runCommandPropertiesBody.SourceCommandId ?? null; set => _runCommandPropertiesBody.SourceCommandId = value; } - - /// Specifies the script content to be executed on the machine. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script content to be executed on the machine.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - public string SourceScript { get => _runCommandPropertiesBody.SourceScript ?? null; set => _runCommandPropertiesBody.SourceScript = value; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - public string SourceScriptUri { get => _runCommandPropertiesBody.SourceScriptUri ?? null; set => _runCommandPropertiesBody.SourceScriptUri = 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.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The ID of the target subscription.", - SerializedName = @"subscriptionId", - PossibleTypes = new [] { typeof(string) })] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo( - Name = @"", - Description =@"", - Script = @"(Get-AzContext).Subscription.Id", - SetCondition = @"")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tag { get => _runCommandPropertiesBody.Tags ?? null /* object */; set => _runCommandPropertiesBody.Tags = value; } - - /// The timeout in seconds to execute the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The timeout in seconds to execute the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - public int TimeoutInSecond { get => _runCommandPropertiesBody.TimeoutInSecond ?? default(int); set => _runCommandPropertiesBody.TimeoutInSecond = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzConnectedMachineRunCommand_UpdateExpanded - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.UpdateAzConnectedMachineRunCommand_UpdateExpanded Clone() - { - var clone = new UpdateAzConnectedMachineRunCommand_UpdateExpanded(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._runCommandPropertiesBody = this._runCommandPropertiesBody; - clone.SubscriptionId = this.SubscriptionId; - clone.ResourceGroupName = this.ResourceGroupName; - clone.MachineName = this.MachineName; - clone.RunCommandName = this.RunCommandName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - _runCommandPropertiesBody = await this.Client.MachineRunCommandsGetWithResult(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, this, Pipeline); - this.Update_runCommandPropertiesBody(); - await this.Client.MachineRunCommandsCreateOrUpdate(SubscriptionId, ResourceGroupName, MachineName, RunCommandName, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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,MachineName=MachineName,RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzConnectedMachineRunCommand_UpdateExpanded() - { - - } - - private void Update_runCommandPropertiesBody() - { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) - { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Parameter"))) - { - this.Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[])(this.MyInvocation?.BoundParameters["Parameter"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ProtectedParameter"))) - { - this.ProtectedParameter = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[])(this.MyInvocation?.BoundParameters["ProtectedParameter"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AsyncExecution"))) - { - this.AsyncExecution = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["AsyncExecution"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunAsUser"))) - { - this.RunAsUser = (string)(this.MyInvocation?.BoundParameters["RunAsUser"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunAsPassword"))) - { - this.RunAsPassword = (string)(this.MyInvocation?.BoundParameters["RunAsPassword"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TimeoutInSecond"))) - { - this.TimeoutInSecond = (int)(this.MyInvocation?.BoundParameters["TimeoutInSecond"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobUri"))) - { - this.OutputBlobUri = (string)(this.MyInvocation?.BoundParameters["OutputBlobUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobUri"))) - { - this.ErrorBlobUri = (string)(this.MyInvocation?.BoundParameters["ErrorBlobUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceScript"))) - { - this.SourceScript = (string)(this.MyInvocation?.BoundParameters["SourceScript"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceScriptUri"))) - { - this.SourceScriptUri = (string)(this.MyInvocation?.BoundParameters["SourceScriptUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceCommandId"))) - { - this.SourceCommandId = (string)(this.MyInvocation?.BoundParameters["SourceCommandId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobManagedIdentityClientId"))) - { - this.OutputBlobManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["OutputBlobManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobManagedIdentityObjectId"))) - { - this.OutputBlobManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["OutputBlobManagedIdentityObjectId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobManagedIdentityClientId"))) - { - this.ErrorBlobManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["ErrorBlobManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobManagedIdentityObjectId"))) - { - this.ErrorBlobManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["ErrorBlobManagedIdentityObjectId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScriptUriManagedIdentityClientId"))) - { - this.ScriptUriManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["ScriptUriManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScriptUriManagedIdentityObjectId"))) - { - this.ScriptUriManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["ScriptUriManagedIdentityObjectId"]); - } - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentity.cs deleted file mode 100644 index 7a98c3722cff..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentity.cs +++ /dev/null @@ -1,598 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to update a run command. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConnectedMachineRunCommand_UpdateViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - public partial class UpdateAzConnectedMachineRunCommand_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandProperty; - - /// Describes a Run Command - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes a Run Command", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Describes a Run Command", - SerializedName = @"runCommandProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand RunCommandProperty { get => this._runCommandProperty; set => this._runCommandProperty = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzConnectedMachineRunCommand_UpdateViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.UpdateAzConnectedMachineRunCommand_UpdateViaIdentity Clone() - { - var clone = new UpdateAzConnectedMachineRunCommand_UpdateViaIdentity(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.RunCommandProperty = this.RunCommandProperty; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - RunCommandProperty = await this.Client.MachineRunCommandsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); - this.UpdateRunCommandProperty(); - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(InputObject.Id, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.RunCommandName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RunCommandName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - RunCommandProperty = await this.Client.MachineRunCommandsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MachineName ?? null, InputObject.RunCommandName ?? null, this, Pipeline); - this.UpdateRunCommandProperty(); - await this.Client.MachineRunCommandsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MachineName ?? null, InputObject.RunCommandName ?? null, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzConnectedMachineRunCommand_UpdateViaIdentity() - { - - } - - private void UpdateRunCommandProperty() - { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunCommandProperty"))) - { - this.RunCommandProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand)(this.MyInvocation?.BoundParameters["RunCommandProperty"]); - } - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded.cs deleted file mode 100644 index f66ebb9bf58e..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded.cs +++ /dev/null @@ -1,882 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to update a run command. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConnectedMachineRunCommand_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - public partial class UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Describes a Run Command - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand(); - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter AsyncExecution { get => _runCommandPropertiesBody.AsyncExecution ?? default(global::System.Management.Automation.SwitchParameter); set => _runCommandPropertiesBody.AsyncExecution = value; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityClientId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobUri { get => _runCommandPropertiesBody.ErrorBlobUri ?? null; set => _runCommandPropertiesBody.ErrorBlobUri = value; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityClientId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobUri { get => _runCommandPropertiesBody.OutputBlobUri ?? null; set => _runCommandPropertiesBody.OutputBlobUri = value; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] Parameter { get => _runCommandPropertiesBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.HttpPipeline Pipeline { get; set; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] ProtectedParameter { get => _runCommandPropertiesBody.ProtectedParameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.ProtectedParameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// 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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account password on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - public string RunAsPassword { get => _runCommandPropertiesBody.RunAsPassword ?? null; set => _runCommandPropertiesBody.RunAsPassword = value; } - - /// Specifies the user account on the machine when executing the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - public string RunAsUser { get => _runCommandPropertiesBody.RunAsUser ?? null; set => _runCommandPropertiesBody.RunAsUser = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityClientId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityObjectId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId = value; } - - /// Specifies the commandId of predefined built-in script. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the commandId of predefined built-in script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - public string SourceCommandId { get => _runCommandPropertiesBody.SourceCommandId ?? null; set => _runCommandPropertiesBody.SourceCommandId = value; } - - /// Specifies the script content to be executed on the machine. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script content to be executed on the machine.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - public string SourceScript { get => _runCommandPropertiesBody.SourceScript ?? null; set => _runCommandPropertiesBody.SourceScript = value; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - public string SourceScriptUri { get => _runCommandPropertiesBody.SourceScriptUri ?? null; set => _runCommandPropertiesBody.SourceScriptUri = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tag { get => _runCommandPropertiesBody.Tags ?? null /* object */; set => _runCommandPropertiesBody.Tags = value; } - - /// The timeout in seconds to execute the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The timeout in seconds to execute the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - public int TimeoutInSecond { get => _runCommandPropertiesBody.TimeoutInSecond ?? default(int); set => _runCommandPropertiesBody.TimeoutInSecond = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded Clone() - { - var clone = new UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._runCommandPropertiesBody = this._runCommandPropertiesBody; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - _runCommandPropertiesBody = await this.Client.MachineRunCommandsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); - this.Update_runCommandPropertiesBody(); - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(InputObject.Id, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.RunCommandName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RunCommandName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - _runCommandPropertiesBody = await this.Client.MachineRunCommandsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MachineName ?? null, InputObject.RunCommandName ?? null, this, Pipeline); - this.Update_runCommandPropertiesBody(); - await this.Client.MachineRunCommandsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.MachineName ?? null, InputObject.RunCommandName ?? null, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzConnectedMachineRunCommand_UpdateViaIdentityExpanded() - { - - } - - private void Update_runCommandPropertiesBody() - { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) - { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Parameter"))) - { - this.Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[])(this.MyInvocation?.BoundParameters["Parameter"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ProtectedParameter"))) - { - this.ProtectedParameter = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[])(this.MyInvocation?.BoundParameters["ProtectedParameter"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AsyncExecution"))) - { - this.AsyncExecution = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["AsyncExecution"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunAsUser"))) - { - this.RunAsUser = (string)(this.MyInvocation?.BoundParameters["RunAsUser"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunAsPassword"))) - { - this.RunAsPassword = (string)(this.MyInvocation?.BoundParameters["RunAsPassword"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TimeoutInSecond"))) - { - this.TimeoutInSecond = (int)(this.MyInvocation?.BoundParameters["TimeoutInSecond"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobUri"))) - { - this.OutputBlobUri = (string)(this.MyInvocation?.BoundParameters["OutputBlobUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobUri"))) - { - this.ErrorBlobUri = (string)(this.MyInvocation?.BoundParameters["ErrorBlobUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceScript"))) - { - this.SourceScript = (string)(this.MyInvocation?.BoundParameters["SourceScript"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceScriptUri"))) - { - this.SourceScriptUri = (string)(this.MyInvocation?.BoundParameters["SourceScriptUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceCommandId"))) - { - this.SourceCommandId = (string)(this.MyInvocation?.BoundParameters["SourceCommandId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobManagedIdentityClientId"))) - { - this.OutputBlobManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["OutputBlobManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobManagedIdentityObjectId"))) - { - this.OutputBlobManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["OutputBlobManagedIdentityObjectId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobManagedIdentityClientId"))) - { - this.ErrorBlobManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["ErrorBlobManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobManagedIdentityObjectId"))) - { - this.ErrorBlobManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["ErrorBlobManagedIdentityObjectId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScriptUriManagedIdentityClientId"))) - { - this.ScriptUriManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["ScriptUriManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScriptUriManagedIdentityObjectId"))) - { - this.ScriptUriManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["ScriptUriManagedIdentityObjectId"]); - } - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine.cs deleted file mode 100644 index e99f12cb723b..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine.cs +++ /dev/null @@ -1,612 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to update a run command. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConnectedMachineRunCommand_UpdateViaIdentityMachine", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - public partial class UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _machineInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity MachineInputObject { get => this._machineInputObject; set => this._machineInputObject = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandProperty; - - /// Describes a Run Command - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Describes a Run Command", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Describes a Run Command", - SerializedName = @"runCommandProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand RunCommandProperty { get => this._runCommandProperty; set => this._runCommandProperty = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine Clone() - { - var clone = new UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.RunCommandName = this.RunCommandName; - clone.RunCommandProperty = this.RunCommandProperty; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (MachineInputObject?.Id != null) - { - this.MachineInputObject.Id += $"/runCommands/{(global::System.Uri.EscapeDataString(this.RunCommandName.ToString()))}"; - RunCommandProperty = await this.Client.MachineRunCommandsGetViaIdentityWithResult(MachineInputObject.Id, this, Pipeline); - this.UpdateRunCommandProperty(); - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(MachineInputObject.Id, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - else - { - // try to call with PATH parameters from Input Object - if (null == MachineInputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - RunCommandProperty = await this.Client.MachineRunCommandsGetWithResult(MachineInputObject.SubscriptionId ?? null, MachineInputObject.ResourceGroupName ?? null, MachineInputObject.MachineName ?? null, RunCommandName, this, Pipeline); - this.UpdateRunCommandProperty(); - await this.Client.MachineRunCommandsCreateOrUpdate(MachineInputObject.SubscriptionId ?? null, MachineInputObject.ResourceGroupName ?? null, MachineInputObject.MachineName ?? null, RunCommandName, RunCommandProperty, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet class. - /// - public UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachine() - { - - } - - private void UpdateRunCommandProperty() - { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunCommandProperty"))) - { - this.RunCommandProperty = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand)(this.MyInvocation?.BoundParameters["RunCommandProperty"]); - } - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded.cs deleted file mode 100644 index fb2d5521a5e6..000000000000 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded.cs +++ /dev/null @@ -1,895 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell; - using Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Cmdlets; - using System; - - /// The operation to update a run command. - /// - /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}" - /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - public partial class UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext - { - /// A unique id generatd for the this cmdlet when it is instantiated. - private string __correlationId = System.Guid.NewGuid().ToString(); - - /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) - private global::System.Management.Automation.InvocationInfo __invocationInfo; - - /// A unique id generatd for the this cmdlet when ProcessRecord() is called. - private string __processRecordId; - - /// - /// The for this operation. - /// - private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - - /// A dictionary to carry over additional data for pipeline. - private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - - /// A buffer to record first returned object in response. - private object _firstResponse = null; - - /// - /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. - /// Two means multiple returned objects in response. - /// - private int _responseSize = 0; - - /// Describes a Run Command - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand _runCommandPropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.MachineRunCommand(); - - /// when specified, runs this cmdlet as a PowerShell job - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - - /// - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete.", - SerializedName = @"asyncExecution", - PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] - public global::System.Management.Automation.SwitchParameter AsyncExecution { get => _runCommandPropertiesBody.AsyncExecution ?? default(global::System.Management.Automation.SwitchParameter); set => _runCommandPropertiesBody.AsyncExecution = value; } - - /// Wait for .NET debugger to attach - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter Break { get; set; } - - /// Accessor for cancellationTokenSource. - public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } - - /// The reference to the client API class. - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ConnectedMachine Client => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.ClientAPI; - - /// - /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet - /// against a different subscription - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] - [global::System.Management.Automation.ValidateNotNull] - [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Azure)] - public global::System.Management.Automation.PSObject DefaultProfile { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityClientId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ErrorBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter.", - SerializedName = @"errorBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string ErrorBlobUri { get => _runCommandPropertiesBody.ErrorBlobUri ?? null; set => _runCommandPropertiesBody.ErrorBlobUri = value; } - - /// Accessor for extensibleParameters. - public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } - - /// SendAsync Pipeline Steps to be appended to the front of the pipeline - [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] - [global::System.Management.Automation.ValidateNotNull] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - - /// Accessor for our copy of the InvocationInfo. - public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity _machineInputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity MachineInputObject { get => this._machineInputObject; set => this._machineInputObject = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener.Token => _cancellationTokenSource.Token; - - /// - /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue - /// asynchronously. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter NoWait { get; set; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityClientId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobManagedIdentityObjectId { get => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.OutputBlobManagedIdentityObjectId = value; } - - /// - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, - /// write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. ", - SerializedName = @"outputBlobUri", - PossibleTypes = new [] { typeof(string) })] - public string OutputBlobUri { get => _runCommandPropertiesBody.OutputBlobUri ?? null; set => _runCommandPropertiesBody.OutputBlobUri = value; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] Parameter { get => _runCommandPropertiesBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// - /// The instance of the that the remote call will use. - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.HttpPipeline Pipeline { get; set; } - - /// The parameters used by the script. - [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The parameters used by the script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The parameters used by the script.", - SerializedName = @"protectedParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[] ProtectedParameter { get => _runCommandPropertiesBody.ProtectedParameter?.ToArray() ?? null /* fixedArrayOf */; set => _runCommandPropertiesBody.ProtectedParameter = (value != null ? new System.Collections.Generic.List(value) : null); } - - /// 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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Runtime)] - public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - - /// - /// Specifies the user account password on the machine when executing the run command. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account password on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account password on the machine when executing the run command.", - SerializedName = @"runAsPassword", - PossibleTypes = new [] { typeof(string) })] - public string RunAsPassword { get => _runCommandPropertiesBody.RunAsPassword ?? null; set => _runCommandPropertiesBody.RunAsPassword = value; } - - /// Specifies the user account on the machine when executing the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the user account on the machine when executing the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the user account on the machine when executing the run command.", - SerializedName = @"runAsUser", - PossibleTypes = new [] { typeof(string) })] - public string RunAsUser { get => _runCommandPropertiesBody.RunAsUser ?? null; set => _runCommandPropertiesBody.RunAsUser = value; } - - /// Backing field for property. - private string _runCommandName; - - /// The name of the run command. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the run command.")] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the run command.", - SerializedName = @"runCommandName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Path)] - public string RunCommandName { get => this._runCommandName; set => this._runCommandName = value; } - - /// - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityClientId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityClientId = value; } - - /// - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.", - SerializedName = @"objectId", - PossibleTypes = new [] { typeof(string) })] - public string ScriptUriManagedIdentityObjectId { get => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId ?? null; set => _runCommandPropertiesBody.ScriptUriManagedIdentityObjectId = value; } - - /// Specifies the commandId of predefined built-in script. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the commandId of predefined built-in script.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the commandId of predefined built-in script.", - SerializedName = @"commandId", - PossibleTypes = new [] { typeof(string) })] - public string SourceCommandId { get => _runCommandPropertiesBody.SourceCommandId ?? null; set => _runCommandPropertiesBody.SourceCommandId = value; } - - /// Specifies the script content to be executed on the machine. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script content to be executed on the machine.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script content to be executed on the machine.", - SerializedName = @"script", - PossibleTypes = new [] { typeof(string) })] - public string SourceScript { get => _runCommandPropertiesBody.SourceScript ?? null; set => _runCommandPropertiesBody.SourceScript = value; } - - /// - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.", - SerializedName = @"scriptUri", - PossibleTypes = new [] { typeof(string) })] - public string SourceScriptUri { get => _runCommandPropertiesBody.SourceScriptUri ?? null; set => _runCommandPropertiesBody.SourceScriptUri = value; } - - /// Resource tags. - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags Tag { get => _runCommandPropertiesBody.Tags ?? null /* object */; set => _runCommandPropertiesBody.Tags = value; } - - /// The timeout in seconds to execute the run command. - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The timeout in seconds to execute the run command.")] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timeout in seconds to execute the run command.", - SerializedName = @"timeoutInSeconds", - PossibleTypes = new [] { typeof(int) })] - public int TimeoutInSecond { get => _runCommandPropertiesBody.TimeoutInSecond ?? default(int); set => _runCommandPropertiesBody.TimeoutInSecond = value; } - - /// - /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what - /// happens on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// /// Determines if the rest of the onDefault method should be processed, or if the method should - /// return immediately (set to true to skip further processing ) - - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens - /// on that response. Implement this method in a partial class to enable this behavior - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// from the remote call - /// /// Determines if the rest of the onOk method should be processed, or if the method should return - /// immediately (set to true to skip further processing ) - - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); - - /// - /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) - /// - protected override void BeginProcessing() - { - var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryId.Invoke(); - if (telemetryId != "" && telemetryId != "internal") - { - __correlationId = telemetryId; - } - Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); - if (Break) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.AttachDebugger.Break(); - } - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - - /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// - /// a duplicate instance of UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded - /// - public Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets.UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded Clone() - { - var clone = new UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded(); - clone.__correlationId = this.__correlationId; - clone.__processRecordId = this.__processRecordId; - clone.DefaultProfile = this.DefaultProfile; - clone.InvocationInformation = this.InvocationInformation; - clone.Proxy = this.Proxy; - clone.Pipeline = this.Pipeline; - clone.AsJob = this.AsJob; - clone.Break = this.Break; - clone.ProxyCredential = this.ProxyCredential; - clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; - clone.HttpPipelinePrepend = this.HttpPipelinePrepend; - clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._runCommandPropertiesBody = this._runCommandPropertiesBody; - clone.RunCommandName = this.RunCommandName; - return clone; - } - - /// Performs clean-up after the command execution - protected override void EndProcessing() - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } - var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); - if (telemetryInfo != null) - { - telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); - telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); - telemetryInfo.TryGetValue("InvocationName", out var invocationName); - if (showSecretsWarning == "true") - { - if (string.IsNullOrEmpty(sanitizedProperties)) - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - else - { - WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); - } - } - } - } - - /// Handles/Dispatches events during the call to the REST service. - /// The message id - /// The message cancellation token. When this call is cancelled, this should be true - /// Detailed message data for the message event. - /// - /// A that will be complete when handling of the message is completed. - /// - async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.Events.Verbose: - { - WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Warning: - { - WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Information: - { - // When an operation supports asjob, Information messages must go thru verbose. - WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Debug: - { - WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Error: - { - WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.Progress: - { - var data = messageData(); - int progress = (int)data.Value; - string activityMessage, statusDescription; - global::System.Management.Automation.ProgressRecordType recordType; - if (progress < 100) - { - activityMessage = "In progress"; - statusDescription = "Checking operation status"; - recordType = System.Management.Automation.ProgressRecordType.Processing; - } - else - { - activityMessage = "Completed"; - statusDescription = "Completed"; - recordType = System.Management.Automation.ProgressRecordType.Completed; - } - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) - { - PercentComplete = progress, - RecordType = recordType - }); - return ; - } - case Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.DelayBeforePolling: - { - var data = messageData(); - if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = response.GetFirstHeader(@"Location"); - var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; - WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); - // do nothing more. - data.Cancel(); - return; - } - } - else - { - if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) - { - int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - WriteDebug($"Delaying {delay} seconds before polling."); - for (var now = 0; now < delay; ++now) - { - WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") - { - PercentComplete = now * 100 / delay - }); - await global::System.Threading.Tasks.Task.Delay(1000, token); - } - } - } - break; - } - } - await Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - __processRecordId = System.Guid.NewGuid().ToString(); - try - { - // work - if (ShouldProcess($"Call remote 'MachineRunCommandsCreateOrUpdate' operation")) - { - if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) - { - var instance = this.Clone(); - var job = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); - JobRepository.Add(job); - var task = instance.ProcessRecordAsync(); - job.Monitor(task); - WriteObject(job); - } - else - { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token) ) - { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.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.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); - if (null != HttpPipelinePrepend) - { - Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); - } - if (null != HttpPipelineAppend) - { - Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); - } - // get the client instance - try - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (MachineInputObject?.Id != null) - { - this.MachineInputObject.Id += $"/runCommands/{(global::System.Uri.EscapeDataString(this.RunCommandName.ToString()))}"; - _runCommandPropertiesBody = await this.Client.MachineRunCommandsGetViaIdentityWithResult(MachineInputObject.Id, this, Pipeline); - this.Update_runCommandPropertiesBody(); - await this.Client.MachineRunCommandsCreateOrUpdateViaIdentity(MachineInputObject.Id, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - else - { - // try to call with PATH parameters from Input Object - if (null == MachineInputObject.SubscriptionId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.ResourceGroupName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - if (null == MachineInputObject.MachineName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("MachineInputObject has null value for MachineInputObject.MachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, MachineInputObject) ); - } - _runCommandPropertiesBody = await this.Client.MachineRunCommandsGetWithResult(MachineInputObject.SubscriptionId ?? null, MachineInputObject.ResourceGroupName ?? null, MachineInputObject.MachineName ?? null, RunCommandName, this, Pipeline); - this.Update_runCommandPropertiesBody(); - await this.Client.MachineRunCommandsCreateOrUpdate(MachineInputObject.SubscriptionId ?? null, MachineInputObject.ResourceGroupName ?? null, MachineInputObject.MachineName ?? null, RunCommandName, _runCommandPropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SerializationMode.IncludeUpdate); - } - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - } - catch (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.UndeclaredResponseException urexception) - { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RunCommandName=RunCommandName}) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } - }); - } - finally - { - await ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Events.CmdletProcessRecordAsyncEnd); - } - } - } - - /// Interrupts currently running code within the command. - protected override void StopProcessing() - { - ((Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener)this).Cancel(); - base.StopProcessing(); - } - - /// - /// Initializes a new instance of the cmdlet - /// class. - /// - public UpdateAzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded() - { - - } - - private void Update_runCommandPropertiesBody() - { - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) - { - this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Parameter"))) - { - this.Parameter = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[])(this.MyInvocation?.BoundParameters["Parameter"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ProtectedParameter"))) - { - this.ProtectedParameter = (Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[])(this.MyInvocation?.BoundParameters["ProtectedParameter"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AsyncExecution"))) - { - this.AsyncExecution = (global::System.Management.Automation.SwitchParameter)(this.MyInvocation?.BoundParameters["AsyncExecution"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunAsUser"))) - { - this.RunAsUser = (string)(this.MyInvocation?.BoundParameters["RunAsUser"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RunAsPassword"))) - { - this.RunAsPassword = (string)(this.MyInvocation?.BoundParameters["RunAsPassword"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("TimeoutInSecond"))) - { - this.TimeoutInSecond = (int)(this.MyInvocation?.BoundParameters["TimeoutInSecond"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobUri"))) - { - this.OutputBlobUri = (string)(this.MyInvocation?.BoundParameters["OutputBlobUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobUri"))) - { - this.ErrorBlobUri = (string)(this.MyInvocation?.BoundParameters["ErrorBlobUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceScript"))) - { - this.SourceScript = (string)(this.MyInvocation?.BoundParameters["SourceScript"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceScriptUri"))) - { - this.SourceScriptUri = (string)(this.MyInvocation?.BoundParameters["SourceScriptUri"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SourceCommandId"))) - { - this.SourceCommandId = (string)(this.MyInvocation?.BoundParameters["SourceCommandId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobManagedIdentityClientId"))) - { - this.OutputBlobManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["OutputBlobManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("OutputBlobManagedIdentityObjectId"))) - { - this.OutputBlobManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["OutputBlobManagedIdentityObjectId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobManagedIdentityClientId"))) - { - this.ErrorBlobManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["ErrorBlobManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ErrorBlobManagedIdentityObjectId"))) - { - this.ErrorBlobManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["ErrorBlobManagedIdentityObjectId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScriptUriManagedIdentityClientId"))) - { - this.ScriptUriManagedIdentityClientId = (string)(this.MyInvocation?.BoundParameters["ScriptUriManagedIdentityClientId"]); - } - if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ScriptUriManagedIdentityObjectId"))) - { - this.ScriptUriManagedIdentityObjectId = (string)(this.MyInvocation?.BoundParameters["ScriptUriManagedIdentityObjectId"]); - } - } - - /// - new protected void WriteObject(object sendToPipeline) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline); - } - - /// - /// - new protected void WriteObject(object sendToPipeline, bool enumerateCollection) - { - Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); - base.WriteObject(sendToPipeline, enumerateCollection); - } - - /// - /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). - /// - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IErrorResponse - /// from the remote call - /// - /// A that will be complete when handling of the method is completed. - /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) - { - using( NoSynchronizationContext ) - { - var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); - overrideOnDefault(responseMessage, response, ref _returnNow); - // if overrideOnDefault has returned true, then return right away. - if ((null != _returnNow && await _returnNow)) - { - return ; - } - // Error Response : default - var code = (await response)?.Code; - var message = (await response)?.Message; - if ((null == code || null == message)) - { - // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } - }); - } - else - { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) - { - ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } - }); - } - } - } - - /// a delegate that is called when the remote service returns 200 (OK). - /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand - /// 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.ConnectedMachine.Models.IMachineRunCommand - var result = (await response); - if (null != result) - { - if (0 == _responseSize) - { - _firstResponse = result; - _responseSize = 1; - } - else - { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); - } - WriteObject(result.AddMultipleTypeNameIntoPSObject()); - _responseSize = 2; - } - } - } - } - } -} \ No newline at end of file diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs index 252ff47b667f..ea0dcb717b43 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_Update.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachine_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs index 99f9e1a64b18..4e86ed52604f 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachine_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs index c30273520ea7..0439c1aafb9a 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentity.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachine_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs index 4e4d7ec69a1c..15a09fae208b 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaIdentityExpanded.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedMachine_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs index cd339a3d3f61..d5616d9d45dc 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonFilePath.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedMachine_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs index dc10c01e84ee..3decf9643df6 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedMachine_UpdateViaJsonString.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"The operation to update a hybrid machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedMachine_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs index e63f01ce3754..90fb1db788f1 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_Update.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedPrivateLinkScopeTag_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs index d8465b9db6f2..843eb58ea419 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedPrivateLinkScopeTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs index c7782af3d90f..29c4f35792e2 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs index 7dd700bc84a9..729fe7aa02ca 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] public partial class UpdateAzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IContext diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs index 7c455a0f9211..b1040962022b 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs index 0df3be778122..1e605eb298e3 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/generated/cmdlets/UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope))] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Description(@"update an existing PrivateLinkScope's tags. To update other fields use the CreateOrupdate method.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-05-20-preview")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}", ApiVersion = "2024-07-10")] [global::Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.NotSuggestDefaultParameterSet] public partial class UpdateAzConnectedPrivateLinkScopeTag_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.IEventListener, diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/ProxyCmdletDefinitions.ps1 index 3e70c47d261a..4d14697b8ec0 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -144,30 +144,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/Update-AzConnectedMachine.ps1 b/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/Update-AzConnectedMachine.ps1 index 3ac2e22c2992..621d472408bf 100644 --- a/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/Update-AzConnectedMachine.ps1 +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/internal/Update-AzConnectedMachine.ps1 @@ -34,30 +34,21 @@ 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 - [BaseProvider ]: The name of the base Resource Provider. - [BaseResourceName ]: The name of the base resource. - [BaseResourceType ]: The name of the base Resource Type. [ExtensionName ]: The name of the machine extension. [ExtensionType ]: The extensionType of the Extension being received. - [GatewayName ]: The name of the Gateway. [GroupName ]: The name of the private link resource. [Id ]: Resource identity path [LicenseName ]: The name of the license. [LicenseProfileName ]: The name of the license profile. [Location ]: The location of the Extension being received. [MachineName ]: The name of the hybrid machine. - [MetadataName ]: Name of the HybridIdentityMetadata. [Name ]: The name of the hybrid machine. - [OSType ]: Defines the os type. [PerimeterName ]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName ]: The name of the private endpoint connection. [PrivateLinkScopeId ]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher ]: The publisher of the Extension being received. [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ResourceUri ]: The fully qualified Azure Resource manager identifier of the resource to be connected. - [RunCommandName ]: The name of the run command. [ScopeName ]: The name of the Azure Arc PrivateLinkScope resource. - [SettingsResourceName ]: The name of the settings resource. [SubscriptionId ]: The ID of the target subscription. [Version ]: The version of the Extension being received. diff --git a/generated/ConnectedMachine/ConnectedMachine.Autorest/resources/README.md b/generated/ConnectedMachine/ConnectedMachine.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/ConnectedMachine/ConnectedMachine.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file